Vidyalelo
C++ Programming · Q29

Constructors and Destructors in C++

Programming · C++ Programming · question 29

Q29

What happens if a constructor throws an exception in C++?

A.
The destructor is called to deallocate resources
B.
The object is not fully constructed
Answer
C.
The object is still constructed but may have undefined behavior
D.
None of the above

Answer: Option B

Solution

Answer: Option B
No explanation is given for this question Let's Discuss on Board