Question OOP-CTOR-0080
HardWhat happens to members of a C++ object whose constructor throws an exception?
- A.
The exception is ignored
- B.
The destructor runs normally
- C.
Sign up free to see the answer and a step-by-step explanation.
Popular companies
Prepare company by company
Hiring pattern, syllabus, past questions and mocks for each company.
All companiesPractice by subject
Constructors and Destructors question
What happens to members of a C++ object whose constructor throws an exception?
The exception is ignored
The destructor runs normally
Sign up free to see the answer and a step-by-step explanation.
Everything leaks
Fully constructed members and bases are destroyed; the object's own destructor is not run