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

Write about the scope resolution operator?

0 Answers  


What is pointer in c++ with example?

0 Answers  


Is c++ the most powerful language?

0 Answers  


How to declare a function pointer?

0 Answers  


Define private, protected and public access control.

0 Answers  






Explain dangling pointer.

0 Answers  


What is c++ best used for?

0 Answers  


How do you invoke a base member function from a derived class in which you have not overridden that function?

0 Answers  


Explain how would you handle a situation where you cannot call the destructor of a local explicitly?

0 Answers  


What is ios :: in in c++?

0 Answers  


Is python better than c++?

0 Answers  


Explain the problem with overriding functions

0 Answers  


Categories