1 int isLittleEndian(void) 2 { 3 return *(char *)(int []){1} == 1; 4 }
关于Compound Literals,https://gcc.gnu.org/onlinedocs/gcc-3.3.1/gcc/Compound-Literals.html
C语言一个语句判断大小端
原文:http://www.cnblogs.com/albumcover/p/7121917.html