首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > C++ >

cout question解决思路

2012-02-27 
cout questionunsignedchar*p1unsignedlong*p2p1(unsignedchar*)0x801000p2(unsignedlong*)0x810000

cout question
unsigned   char   *p1;
unsigned   long   *p2;
p1   =   (unsigned   char   *)0x801000;
p2   =   (unsigned   long   *)0x810000;
cout   < <   "p1   =   "   < <   p1   < <   endl;
cout   < <   "p2   =   "   < <   p2   < <   endl;
Q:
运行不出结果,提示Segmentation   fault
这是什么原因?

[解决办法]
cout < < "p1 = " < <(void*) p1 < < endl;

热点排行