For example, if a struct contains a char a followed by an int b, typically b would be at offset 4, even though sizeof(a) is 1.
To get tight packing, you need to explicitly tell the compiler to disable padding.
For example, if a struct contains a char a followed by an int b, typically b would be at offset 4, even though sizeof(a) is 1.
To get tight packing, you need to explicitly tell the compiler to disable padding.