Question 19
Back to Exercise
When is it reasonable to use a struct with all-public data members?
- A Never
- B For simple data aggregates with no invariants, such as a Point {x, y} or a configuration record Correct
- C For bank accounts
- D Whenever performance matters
Correct Answer: Option B
If any combination of member values is valid, there is nothing to protect.
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!