Question 2
Back to Exercise
On a typical 64-bit system, what is sizeof(struct { char c; int i; })?
- A 5
- B 8 Correct
- C 6
- D 16
Correct Answer: Option B
The int must start at a multiple of 4, so 3 padding bytes follow c: 1 + 3 + 4 = 8. The size of a struct is often larger than the sum of its members.
Discussion & Comments 0
Share your method, a shortcut, or ask about a step you didn't follow.
No comments yet. Be the first to share your solution!