Practice ยท 2 of 3
Predict construction order
Implement class Parent with a constructor printing parent and a destructor printing ~parent, and class Child : public Parent whose constructor prints child and destructor prints ~child. Use std::cout exactly (no extra text). The test captures construction/destruction inside a scope.
Difficulty: intermediate
Press Submit to check your solution.
Back to lesson: Practice: Inheritance mechanics