#include
int main()
{
union abc
{
char a[4];
int b;
}test;
test.b = 0x12345678;
printf("%x %x %x %x\n", test.a[0],test.a[1],test.a[2],test.a[3]);
return 0;
}
//小尾端的结果为: 78 56 34 12
//大尾端的结果为: 12 34 56 78
C语言联合体内存布局
2027

被折叠的 条评论
为什么被折叠?



