void IsBigEndian() { short int a = 0x1234; char b = *(char *)&a; if(b == 0x12){ //大端 }else{ //小端 } }