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

Write a Program for read a line from file from location N1 to N2 using command line arguments. Eg:exe 10 20 a.c

1232


How do you instruct your compiler to print the contents of the intermediate file showing the effects of the preprocessor?

1087


What is the difference between the functions rand(), random(), srand() and randomize()?

1201


What do you mean by function and operator overloading in c++?

996


What is main function in c++ with example?

1142


Can I uninstall microsoft c++ redistributable?

1040


What is the difference between structures and unions?

1015


Is c++ fully object oriented?

921


Does c++ have string data type?

1060


what is pre-processor in C++?

1092


Should I learn c++ c?

1003


Why is c++ difficult?

994


What are its advantages and disadvantages of multiple inheritances (virtual inheritance)?

1145


What is scope operator in c++?

1041


Describe linkages and types of linkages?

944