What happens if an exception is throws from an, object's
constructor and object's destructor?

Answer Posted / akshay

constructor:
the destructors of all the member objects that were
correctly created are called, then code goes to the catch
statement if any

dtors:
legally allowed, however, it should be caught within the
function. if it is not caught, then it may lead to a call to
terminate() function. this call would happen in the case
when the destructor was itself called due to stack unwinding
happening because of another exception in probably some
other function.

Is This Answer Correct ?    2 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Program to check whether a word is a sub-string or not of a string typed

1602


What is stack unwinding?

612


How is computer programming useful in real life?

601


When the constructor of a base class calls a virtual function, why doesn't the override function of the derived class gets called?

580


Explain about Virtual Function in C++?

617






Explain the difference between c & c++?

594


What is the word you will use when defining a function in base class to allow this function to be a polimorphic function?

676


Can you Mention some Application of C/C++?

628


What is the use of volatile variable?

605


Define token in c++.

720


Write a note about the virtual member function?

608


What do you mean by inheritance in c++? Explain its types.

617


Explain what are single and multiple inheritances in c++?

563


Is java made in c++?

589


What is abstraction c++?

595