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

write a c++ program to create class student having datamember name,Roll_no,age,and branch intilcization all the member using constructor print the all the details on the screen.

2251


How to access a variable of the structure?

585


Can we use this pointer inside static member function?

628


Write a C++ Program to check whether a number is prime number or not?

635


Which recursive sorting technique always makes recursive calls to sort subarrays that are about half size of the original array?

612






What is the return value of the insertion operator?

604


What is meant by a delegate?

608


What does the ios::ate argument do?

663


What do you mean by storage classes?

791


What is dev c++ used for?

605


What are namespaces in c++?

597


Define a constructor?

590


How many standards of c++ are there?

627


What is c++ namespace?

711


Explain class invariant.

586