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

Define stacks. Provide an example where they are useful.

572


Can a Structure contain a Pointer to itself?

606


Write a program to concatenate two strings.

580


Describe the advantage of an external iterator.

612


What is this weird colon-member (" : ") syntax in the constructor?

539






What are single and multiple inheritances in c++?

572


Draw a flow chart and write a program for the difference between the sum of elements with odd and even numbers. Two dimensional array.

5894


What does it mean to declare a member function as virtual?

583


What is the operator in c++?

621


What is pure virtual function?

621


Define 'std'.

601


What is general form of pure virtual function? Explain?

506


Which software is best for coding?

568


What is an inline function in c++?

624


Describe friend function & its advantages.

708