المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : Structure



C++ Programming
07-24-2009, 02:20 AM
Can someone plz explain me this I just want to clarify that am I understanding this correctly or not....

typedef struct
{
unsigned int SizeInBytes;
unsigned char data[MAXBYTES];
} Message;
typedef struct
{
unsigned char MSB;
} PACKET_HEADER;
typedef struct
{
PACKET_HEADER PktHdr;
unsigned char data2[MAX_BYTES];
} PACKET;

const PACKET * const PacketPtr = (PACKET *)&MessagePtr -> data;

(MessagePtr is defined in function parameter
bool function(const Message * const MessagePtr)

THANKS!!!!!