Why does the compiler allocate extra space when we use a structure in a code where one member is of integer type and the other is of character type? I don't understand the necessity for structure padding in this scenario. Specifically, I observed that the compiler allocates a total of 8 bytes of memory (4 bytes for the int type object and 4 bytes for the char type object). on window using GCC compiler
I found a link https://en.m.wikipedia.org/wiki/Data_structure_alignment that provides a description, but I don't understand data structure alignment
I found a link https://en.m.wikipedia.org/wiki/Data_structure_alignment that provides a description, but I don't understand data structure alignment