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;