← Quiz: Structures and Unions: all 10 questions
Quiz: Structures and Unions · Question 4 of 10
Why can sizeof(struct) be bigger than the sum of its members?
Why can sizeof(struct) be bigger than the sum of its members?
- A.Because of the null character
- B.Because of padding for alignment
- C.Because structs store their name
- D.It can't be bigger
Answer & explanation
Correct answer: Because of padding for alignment
The compiler inserts padding so members are aligned.
Can you get the rest right without peeking?
Take the timed Quiz: Structures and Unions quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →