试编写函数判断计算机的字节存储顺序是开序(little endian)还是降序(bigendian)
程序如下:boolIsBigendian(){unsignedshortusData=0x1122;unsignedchar*pucData=(unsignedchar*...
程序如下:
bool IsBigendian()
{
unsigned short usData = 0x1122;
unsigned char *pucData = (unsigned char*)&usData;
return (*pucData == 0x22);
}
看不懂,麻烦各位高手帮忙解释一下 展开
bool IsBigendian()
{
unsigned short usData = 0x1122;
unsigned char *pucData = (unsigned char*)&usData;
return (*pucData == 0x22);
}
看不懂,麻烦各位高手帮忙解释一下 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询