感觉挺有趣的,同一个地址有两个值:
int main() { const int i = 55; const int * p = &i; int *c = (int *)p; *c = 66; cout << "i=" << i << endl; cout << "p=" << *p << endl; cout << "c=" << *c << endl; cout << "p指向的地址" << p << endl; cout << "c指向的地址" << c << endl; cout << "i的地址" << &i << endl; return 0; }
i=55 p=66 c=66 p指向的地址0043FA84 c指向的地址0043FA84 i的地址0043FA84 请按任意键继续. . .
原文:http://www.cnblogs.com/mouse-null/p/6262554.html