C:void main() {union { int k; char i[2]; }*s,a; s=&a; s->i[0]=0x39;s->i[1]=
voidmain(){union{shorti[2];longk;charc[4];}r,*S=&r;s->i[0]=0x39;s->i[1]=0x38;printf("...
void main()
{union
{
short i[2];
long k;
char c[4];
} r,*S=&r;
s->i[0]=0x39;s->i[1]=0x38;
printf("%x\n",s->c[0]);
}
内存有4个字节,0x39占了二个字节,0 x38接着占了二个字节。,s->c[0]是一个字节,应取0x39一个字节,也就是39,对吗 展开
{union
{
short i[2];
long k;
char c[4];
} r,*S=&r;
s->i[0]=0x39;s->i[1]=0x38;
printf("%x\n",s->c[0]);
}
内存有4个字节,0x39占了二个字节,0 x38接着占了二个字节。,s->c[0]是一个字节,应取0x39一个字节,也就是39,对吗 展开
3个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询