[讨论]同一地址,值怎么不一样呢
如下程序:#include <iostream>
using namespace std;
int main()
{
const int i=0;
int* j=(int*)&i;
const int k=0;
int* u=(int*)&k;
*j+=1;
*u+=1;
cout<<i<<" "<<*j<<endl;
cout<<&i<<" "<<j<<endl;
cout<<k<<" "<<*u<<endl;
cout<<&k<<" "<<u<<endl;
std::cin.get();
return 0;
}