c++ 函数体中声明结构体 按字节对齐
直接上代码了
#pragma pack(1)
struct _st_v2x_testingdata
{
int len;
uint8_t cmd;
uint8_t data_type;
char ID[8];
uint64_t sign_verify_time;
uint8_t sign_verify_result;
uint64_t send_receive_time;
int32_t AID;
int32_t CBR;
int32_t msgCnt;
uint64_t secMark;
uint32_t speed;
uint32_t longitude;
uint32_t latitude;
int32_t heading;
char dsmp_payload[0];
};
#pragma pack()
本文链接地址:https://const.net.cn/417.html