64,636
社区成员
发帖
与我相关
我的任务
分享
int main(){
const volatile int x=43;
const volatile int *x3 = &x;
int* x4 = (int *)x3;
*x4 = 56; // cast change the original meaning?
const volatile int *x5 = &x;
std::cout<< &x << ": x ="<<x<<std::endl; // output : 43 why??
std::cout<< x5 << ": x5 ="<<*x5<<std::endl; // output : 56
std::cout<< x3 << ": x3="<<*x3<<std::endl; // output : 56
std::cout<< x4 << ": x4="<<*x4<<std::endl; // output : 56
system("pause");
return 0;
}