请问大侠们:一个内存单元里同时能否放两个值?
#include <stdio.h>void main()
{
const int max=0x12345678;
*(int*)&max=0x99999999;
printf("max = %x\n",max);
printf("&max = %p\n",&max);
printf("*(int*)&max = %x\n",*(int*)&max);
printf("(int*)&max = %p\n",(int*)&max);
}
VC6.0英文版,运行结果:
max=12345678;
&max=0012FF48;
*(int*)&max=99999999;
(int*)&max=0012FF48;