谁能帮我解释一下这道c语言题目啊 不懂
stryctw{charlow;charhigh;};unionu{structwbyte;intword;}uu;main(){uu.word=0x1234;print...
stryct w
{
char low;
char high;
};
union u
{
struct w byte;
int word;
}uu;
main()
{
uu.word=0x1234;
printf("wordvalue:%04x\n",uu.word);
printf("highvalue:%02x\n",byte.high);
printf("lowvalue:%02x\n",uu.byte.low);
uu.byte.low=0xff;
printf("wordvalue:%04x\n",uu.word);
} 展开
{
char low;
char high;
};
union u
{
struct w byte;
int word;
}uu;
main()
{
uu.word=0x1234;
printf("wordvalue:%04x\n",uu.word);
printf("highvalue:%02x\n",byte.high);
printf("lowvalue:%02x\n",uu.byte.low);
uu.byte.low=0xff;
printf("wordvalue:%04x\n",uu.word);
} 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询