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...

is throwing exception from a constructor not a good practice ?

Answer Posted / vikas sood

throwing exception from a constructor is not bad at all. It
is actually advised to use exceptions when you fail to
create your object properly due to any reason. In this case
memory will not be allocated for the object and no
destructor will be called.

Is This Answer Correct ?    11 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the identity function in c++? How is it useful?

1007


What are the 3 levels of programming languages?

1003


What are guid?

1195


Can I learn c++ as my first language?

1072


What does it mean to declare a destructor as static?

1030


What is the default width for ouputting a long integer using the insertion operator?

1201


How can a called function determine the number of arguments that have been passed to it?

1096


Differentiate between a constructor and a destructor in c++.

983


Do you know what are static and dynamic type checking?

1027


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

1109


What is the basic structure of a c++ program?

1097


Explain this pointer?

1018


What is :: operator in c++?

1001


What is the use of endl in c++?

984


What does getch() do according to the ANSI C++ standard a) Reads in a character b) Checks the keyboard buffer c) Nothing in particular (Its not defined there)

1011