#include <stdio.h> #include <stdlib.h> int isLittleEndian() { unsigned short i=1; return (1 == *((char *)&i)); } int main() { if(isLittleEndian()) { printf("低字節序\n"); } else { printf("高字節序\n"); } }