C++20 sections · 1024 units
Open in CourseQuiz: Virtual Destructors
Knowledge check
Check Your Understanding
What happens if you delete a derived object through a base pointer when the base destructor is NOT virtual?
- A.Both destructors run correctly
- B.Compilation error - cannot delete through base pointer
- C.Only the base destructor runs, potentially leaking resources
- D.Only the derived destructor runs