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 / manjunath

Throwing a exception from constructor is perfectly good
habit. That is how to handle errors in the constructor.
Smart pointers can also be used in this scenario.

Is This Answer Correct ?    4 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why c++ is the best language?

1064


What are c++ manipulators?

1072


Mention the purpose of istream class?

1107


What is a linked list in c++?

1047


How can a struct in c++ differs from a struct in c?

1042


Difference between a homogeneous and a heterogeneous container

1140


What is the use of 'this' pointer?

1247


How the endl and setw manipulator works?

1014


Why c++ is not a pure oop language?

1039


What do you mean by volatile and mutable keywords used in c++?

984


What it is and how it might be called (2 methods).

1179


How do I start a c++ project?

1074


total amount of milk produced each morning and then calculates and outputs the number of cartons needed for this milk , the cost of producing the milk and the profit from producing this milk.

2577


How much do coding jobs pay?

1008


What is a buffer c++?

1058