试编写函数判断计算机的字节存储顺序是开序(lit

16 查阅
试编写函数判断计算机的字节存储顺序是开序(little endian)还是降序(bigendian)

参考答案:

正确答案:

\r\n

bool IsBigendian()
{
unsigned short usData = 0x1122;
unsigned char *pucData = (unsigned
char*)&usData;
return (*pucData == 0x22);
}

字节