"); //-->
数组表示的长度 转换成U16. int main(void) { unsigned char buffer[2]={0x11,0x22}; unsigned short msg_len = 0; printf("hello world 22!\r\n"); msg_len = ((U16)(buffer[0] << 8) | (buffer[1])); printf("msg_len is %x\r\n",msg_len); return 0; } U16 类型长度存放到数组中: U16 msg_len = 0x1122; buffer[3] =((msg_len)>>8)&0xFF; buffer[4] =(msg_len)&0xFF;
*博客内容为网友个人发布,仅代表博主个人观点,如有侵权请联系工作人员删除。