3 ms·
> if the struct were instead { int a; char b; } then there would be 3 bytes of padding between a and b. I doubt it. To get 3 bytes of padding between fields, y
by Const-me 7y ago
> if the struct were instead { int a; char b; } then there would be 3 bytes of padding between a and b.
I doubt it. To get 3 bytes of padding between fields, you need this: { char a; int b; }
- tumult 7y agoYes! Sorry, my mistake. int then char on x86 will put the padding at the end of the struct, not in the middle. I had originally written it that other way (char and then int), then edited it to be the other way (int and then char) but didn't update the other text. I edited the post to have this correction.