你可以将highByte左移8位并与lowByte进行按位或操作,得到mapid的值:

uint16_t mapid = (highByte << 8) | lowByte;

#include iostream#include cstdintint main uint16_t mapid = 1687228718; uint8_t highByte = mapid 8 & 0xFF; uint8_t lowByte = mapid & 0xFF; stdcout 0x stdhex unsignedhighByte 0x unsi