union uc{
unsigned long aa;
char b[4];
}test;
int main()
{
test.aa = 0x12345678;
printf("addr is %d char b[0] is %x\n",&test.b[0],test.b[0]);
printf("addr is %d char b[1] is %x\n",&test.b[1],test.b[1]);
printf("addr is %d char b[2] is %x\n",&test.b[2],test.b[2]);
printf("addr is %d char b[3] is %x\n",&test.b[3],test.b[3]);
}
C语言,判断机器大小端
最新推荐文章于 2017-11-18 15:12:31 发布