//如果字节序为big-endian,返回true;反之为little-endian,返回false
bool isBig_Endian()
{
unsigned short x = 0x1234;
if(*(unsigned char*)&x == 0x12)
{
return true;
}
return false;
}
转载于:https://blog.51cto.com/axlrose/1293061
//如果字节序为big-endian,返回true;反之为little-endian,返回false
bool isBig_Endian()
{
unsigned short x = 0x1234;
if(*(unsigned char*)&x == 0x12)
{
return true;
}
return false;
}
转载于:https://blog.51cto.com/axlrose/1293061