If you have an object
struct Packet P;
that consists of
struct Packet {
struct Packet_header header;
unsigned char data[MAXIMUM_BUFFER_LENGTH];
};
and the header consists of
struct Packet_header {
unsigned int checksum;
unsigned int seq;
unsigned int ack;
unsigned int data_length;
};
If I try to cast the packet
(unsigned char*) &P
is there anyway I can “uncast” back to get my original packet P?
1 Answer