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

How did c++ start?

0 Answers  


What is near, far and huge pointers? How many bytes are occupied by them?

0 Answers  


Describe the advantages of operator overloading?

0 Answers  


Can you please explain the difference between overloading and overriding?

0 Answers  


What are the basics of local (auto) objects?

0 Answers  






write a porgram in c++ that reads an integer and print the biggest digit in the number

0 Answers  


Which one is better- macro or function?

0 Answers   Fidelity,


What does scope resolution operator do?

0 Answers  


How the virtual functions maintain the call up?

0 Answers  


Explain working of printf?

8 Answers  


What is a literal in c++?

0 Answers  


How long will it take to learn programming?

0 Answers  


Categories