What is the size (sizeof(How_Many_Bytes)
) of the following structure, given the following machine
parameters:
sizeof(char) == 1; sizeof(int) == 4; sizeof(long) == 8; sizeof(char *) == 8;
Integer values must be aligned.
typedef struct how_many_bytes {
long s;
char c, e;
int i;
char *d;
} How_Many_Bytes;
I thought it would be 4+1+1+(2+4)+8 = 20 bytes but when I run on my machine I get 24 bytes. I wonder why?