typedef struct
{
unsigned short groupId;
unsigned short clusterId;
} afIncomingMSGPacket_t;
afIncomingMSGPacket_t *MSGpkt=0x20;//表示MSGpkt指针式指向0x20这个地址
MSGpkt->groupId=0x0304;
MSGpkt->clusterId=0x0102;
给相对的地址中的变量赋值,但是如果不指定地址,即MSGpkt=0x20,
MSGpkt->groupId=0x0304;
MSGpkt->clusterId=0x0102;
会出错
如下
typedef struct
{
unsigned short groupId;
unsigned short clusterId;
} afIncomingMSGPacket_t;
afIncomingMSGPacket_t *MSGpkt;//不给MSGpkt赋值
MSGpkt->groupId=0x0304;
MSGpkt->clusterId=0x0102;
最后 groupId=0x0300
dusterId=0x0102
不知什么原因,求解~~ |