Question 8
Back to Exercise
A class declares virtual ~Base() = 0;. Must Base::~Base() be defined?
- A No, pure functions never have bodies
- B Yes – every derived destructor calls it, so it must be defined or linking fails Correct
- C Only if Base has data
- D Only in debug builds
Correct Answer: Option B
Destructors run up the whole hierarchy, so the base one always executes.
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!