9/3/2019 10:33:11 AM
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.
2 bytes have been padded, resulting in 8 bytes.
4 bytes int + 2 bytes char + 2 padding bytes...
see this Noor ❤ https://www.sololearn.com/post/78037/?ref=app
I got it now.
Thanks for making the things easy to understand
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
Yes it's structure padding at work.
You have found a good link (Babak's one) go through it and let me know if you need explanation for anything.
Kuri do structure reserves 2 bytes for padding?
GET THE FREE APP
Learn Playing. Play Learning
Send us a message