#include <stdio.h>
#include <stdbool.h>
union {
int number;
char s;
}test;
bool testBigEndin()
{
test.number = 0x01000002;
return (test.s == 0x01);
}
int main()
{
if (testBigEndin())
printf("big");
else
printf("small");
return 0;
}
大端小端测试代码
最新推荐文章于 2024-07-19 10:10:20 发布