typedef struct structA
{
char C;
double D;
int I;
} structA_t;
Size of this structA_t structure:
sizeof(char) + 7 byte padding + sizeof(double) + sizeof(int) = 1 + 7 + 8 + 4 = 20 bytes
But this is wrong , the correct is
24
. Why?
4
for padding afterint
– Raju Kundesizeof(char)=1 Byte
must be padded by 7 Bytes – H_squared