小端

#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");

}

 

posted @ 2021-01-10 15:36  星空下聆听  阅读(66)  评论(0编辑  收藏  举报