#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;
}
大端小端测试代码
最新推荐文章于 2025-06-26 19:50:44 发布