小端模式:多字节时低字节在前
eg:char* p = {0x1E,0x00}代表为0x001E(十进制的30)
->int tem16 = 0;
tmp16 = ((unsigned short)(p[1] << 8)) | (unsigned char)p[0];
-->tem16 == 30
小端模式:多字节时低字节在前
eg:char* p = {0x1E,0x00}代表为0x001E(十进制的30)
->int tem16 = 0;
tmp16 = ((unsigned short)(p[1] << 8)) | (unsigned char)p[0];
-->tem16 == 30
转载于:https://www.cnblogs.com/judes/p/6747541.html