+ 1
Why the output is 8 bytes instead of 6 bytes??
8 Antworten
+ 6
Need not be.
if struct elements are not aligned to it's memory, then only padding will be done.
In 32 bit system, struct size shall be 32 bit aligned.
Padding improves performance.
+ 5
2 bytes have been padded, resulting in 8 bytes.
4 bytes int + 2 bytes char + 2 padding bytes...
+ 4
+ 4
✳AsterisK✳
I got it now.
Thanks for making the things easy to understand
+ 3
i think ~ swim ~ have explained this before, the structure padding works in blocks of 4 or something i can't remember clearly cause am also struggling in this context
+ 1
Kuri do structure reserves 2 bytes for padding?