#include<stdio.h>
int check_sys()
{
union check
{
int i;
char ch;
}c;
c.i = 1;
return (c.ch == 1);
}
int main()
{
int ret = check_sys();
if (ret == 1)
printf("Little_endian\n");
else
printf("Big_endian\n");
system("pause");
return 0;
}
时间: 2024-10-12 20:51:43