Question 4
Back to Exercise
In which order are data members initialized?
- A In the order written in the initializer list
- B In the order they are declared in the class Correct
- C Alphabetically
- D In reverse declaration order
Correct Answer: Option B
Declaration order always wins; compilers warn (-Wreorder) when the initializer list is written in a different order.
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!