What happens if an exception is throws from an object's
constructor and from object's destructor?
Answers were Sorted based on User's Feedback
Answer / rajesh
exception from object's destructor - could terminate the
program while stack unwinding.
Is This Answer Correct ? | 2 Yes | 0 No |
Answer / achal ubbott
If an exception is generated by constructor of the class
that object is not created. That means if you do
delete obj_ptr;
the destructor would not be called.
Is This Answer Correct ? | 1 Yes | 0 No |
Answer / reegan
if an exception is throws from object constructor, it is
caught by catch block .the same thing is happen in the objects
destructor.
Is This Answer Correct ? | 1 Yes | 3 No |
Where Malloc(), Calloc(), and realloc() does get memory?
Is facebook written in c++?
Will c++ be replaced?
Is java easier than c++?
What is a flag in c++?
What is the extraction operator and what does it do?
When should you use multiple inheritance?
What are shallow and deep copies?
Explain what data encapsulation is in c++?
What is polymorphism & list its types in c++?
Check for Balanced Parentheses using Stack?
Should you pass exceptions by value or by reference?