int m_length=0;
char buf[2]=={0x00,0x08};
memcpy(&m_length,&buf[0],2); m_length=m_length<<16; m_length = ntohl(m_length);

然后就可以用m_length 跟整数对比了,

//m_length == 8

 

 

使用ntohl  参考:网址

相关文章:

  • 2021-12-01
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-07-09
  • 2022-12-23
  • 2021-11-01
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-12-08
  • 2021-08-06
  • 2021-12-01
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案