struct ip {
unsigned char ip_length:4;
unsigned char ip_version:4;
unsigned char ip_tos;
unsigned short ip_total_length;
unsigned short ip_id;
unsigned short ip_flags;
unsigned char ip_ttl;
unsigned char ip_protocol;
unsigned short ip_cksum;
unsigned int ip_source;
unsigned int ip_dest;
};
please can anyone please tell why the size of the struct is 24 bytes though if i take ip_length:4 and ip_version:4 out from the structure still the size remains the same .
i tried playing with the structure a lot and am not sure why the size of 2 integers and one char is 12 bytes
thanx
rohit