判断大小端的方法:
#include <stdio.h>
static union{
char c
[4];
unsigned long mylong
;
} endian_test
= { 'l','?','?','b' };
#define ENDIANNESS ( (char) endian_test.mylong )
int main()
{
printf("%c",ENDIANNESS
);
}
转载请注明原文地址: https://lol.8miu.com/read-33124.html