如何使用宏判是否big-endian
用行的代判有很多方法 可是我得是可以用宏判的
怎么判呢...
[解决办法]
就用宏定 移位 + 或算吧。
[解决办法]
#if BYTE_ORDER == BIG_ENDIAN
#if BYTE_ORDER == LITTLE_ENDIAN
[解决办法]
使用联合:
union un{
short s;
char ch;
}
un a;
a.s = 0xff00;
printf( "%d ", a.ch);
看输出值来判断就行了。