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



What happens if an exception is throws from an object's constructor and from object's de..

Answer / rajesh

exception from object's destructor - could terminate the
program while stack unwinding.

Is This Answer Correct ?    2 Yes 0 No

What happens if an exception is throws from an object's constructor and from object's de..

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

What happens if an exception is throws from an object's constructor and from object's de..

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

Post New Answer

More C++ General Interview Questions

Where Malloc(), Calloc(), and realloc() does get memory?

0 Answers  


Is facebook written in c++?

0 Answers  


Will c++ be replaced?

0 Answers  


Is java easier than c++?

0 Answers  


What is a flag in c++?

0 Answers  






What is the extraction operator and what does it do?

0 Answers  


When should you use multiple inheritance?

2 Answers  


What are shallow and deep copies?

0 Answers  


Explain what data encapsulation is in c++?

0 Answers  


What is polymorphism & list its types in c++?

0 Answers  


Check for Balanced Parentheses using Stack?

1 Answers  


Should you pass exceptions by value or by reference?

0 Answers  


Categories