未分类题
struct w
{ char low;
char high;
};
union u
{ struct w byte;
short word;
}uw;
main( )
{ int result;
uw.word=0x1234;
printf(“word value:%04x/n”,uw.word);
printf(“high byte:%02x/n”,uw.byte.high);
printf(“low byte:%02x/n”,uw.byte.low);
uw.byte.low=0x74;
printf(“word value:%04x/n”,uw.word);
result=uw.word+0x2a34;
printf(“the result:%04x/n”,result);
}
A.word=0x1234;
printf(“word
B.word);
C.byte.high);
D.byte.low);
E.byte.low=0x74;
F.word);
G.word+0x2a34;
【参考答案】
5.word value:1234