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

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the full form nasa?

761


What are the three forms of cin.get() and what are their differences?

831


What are function prototypes?

964


why is c++ called oops? Explain

798


What are the two types of polymorphism?

782


Explain the difference between realloc() and free() in c++?

742


What happens if a pointer is deleted twice?

1015


What are default parameters? How are they evaluated in c++ function?

887


How much do c++ programmers make?

764


What is a base class?

803


What would happen on forgetting [], while deallocating an array through new?

834


Do vectors start at 0 c++?

735


What is purpose of abstract class?

788


What is the use of 'using' declaration in c++?

840


What are the uses of c++ in the real world?

768