#include<stdio.h>
union data{
int a;
char b;
}dt;
int main(int argc, const char *argv[])
{
dt.a = 0x12345678;
if(dt.b == 0x78)
{
printf("small\n");
}
else
{
printf("big\n");
}
return 0;
}
标签:判断,int,char,small,printf,大小,共用,dt,main
来源: https://www.cnblogs.com/thismajor/p/15361315.html