Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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

Answer Posted / som shekhar

When an exception is thrown from the object constructor,
then the destructor of the object wont be called. But to
undone all the things that happened in the c'tor before the
exception is thrown, you can make use of smart
pointer(either boost smart pointer or std auto pointer).

when an exception is thrown from the destructor the compiler
terminates the application.

So it is advisable not to throw an exception in the
destructor , better to do "something else".

Is This Answer Correct ?    2 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Which is best ide for c++?

1011


What is string in c++ programming?

1178


How is modularity introduced in C++?

1209


What is difference between n and endl in c++?

1091


What is double in c++?

1062


What is a rooted hierarchy?

1159


What is general form of pure virtual function? Explain?

994


What are the advantages of using typedef in a program?

1140


Why is it necessary to use a reference in the argument to the copy constructor?

1113


What are namespaces in c++?

1089


What is the oldest programming language?

1014


What is an arraylist c++?

1215


What is the extraction operator and what does it do?

1081


Write a C/C++ program that connects to a MySQL server and checks if the InnoDB plug-in is installed on it. If so, your program should print the maximum number of concurrent threads that the InnoDB plug-in can create

2629


How many keywords are used in c++?

1015