#include <stdio.h>
union
{
int a;
char b;
long c;
}A;
int main(int argc, const char *argv[])
{
A.a=0x87654321;
//printf("%0x\n",(A.a));
char *p=(char*)&(A.a);
//printf("%0x\n",*p);
if(*p==0x87)
printf("big--\n");
else if(*p==0x21)
printf("small--\n");
else
printf("fault\n");
return 0;
}
网络编程(3/9)
![](https://img-home.csdnimg.cn/images/20240711042549.png)