双整数转双字节16进制:
int data_l=256;
unsigned char datalength[2] = { 0 };
if (data_l
datalength[0] = 0x00;
datalength[1] = data_l;
} else {
datalength[1] = data_l & 0xFF;
datalength[0] = (data_l & 0xFF00) >> 8;
}
双字节16进制转整数:
char a = 0x80;//低位
char b = 0x00;//高位
int value = (int)((unsigned char)a | (unsigned char)b
unsigned char map_l[2]={0};
memcpy(&map_l,&buffer[j+4],2);
int m_l = (int)(map_l[1]| map_l[0]
int i=-190;
unsigned char * ia=(unsigned char *)&i;
int *p = (int*)ia;