Question 91
What is the total size in bytes of the structure on a 32-bit machine (int=4B, short=2B, 4B alignment enforced)?
CODE
struct Data {
short s;
int i;
short t;
};Detailed Solution
s takes 2B + 2B padding (4B). 'i' takes 4B (8B). 't' takes 2B + 2B trailing padding to align to 4B, yielding 12B.
✓ Saved