小端

#include <stdio.h>
int IsBigEndian()
{ 
union NUM 
{ 
int a; 
char b;
}num; 
num.a = 0x1234; 
if( num.b == 0x12 )
{ 
return 1;
} 
return 0;
}
void main(void)
{
int i;
i = IsBigEndian();
printf("%d",i);
system("pause");

}
原文地址:https://www.cnblogs.com/wy9264/p/14258484.html