This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

例子程序中结构体强制转换问题

例子程序中有这一句: zclSampleLight_ProcessIncomingMsg( (zclIncomingMsg_t *)MSGpkt );

MSGpkt 实际的结构体是afIncomingMSGPacket_t, 但这里强制转换成zclIncomingMsg_t。

仔细看了这两个结构体构成,似乎没有直接的数据对应关系。

请问意义在哪里,怎么保持数据对齐?