您的位置:首页 > 其它

任意地址赋值,编译没问题,运行时错误

2009-07-27 14:53 387 查看
==

#include <iostream>
using namespace std ;

int main(void)
{
int *p = (int*)1234; //编译没问题,但运行时出错
*p = 190 ; // not writeable

system("pause") ;
return 0 ;
}

// output: run time error! access voilation!


==
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: