size of int
in my system is 4
bytes and char
is 1
byte ,so I thought size of this struct
will be 10
(4+6) bytes.
struct Riddle {
int n;
char s[6];
};
but it is 12
bytes(checked with printf("%d",sizeof(Riddle))
.
this might be a stupid question ,but it really confused me.
can you explain to me how is it possible?
thanks for help.