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
What is the outcome of cout< a) 16 b) 17 c) 16.5
What is isdigit c++?
What is the return value of the insertion operator?
Will a recursive function without an end condition every quit, in practice a) Compiler-Specific (Some can convert to an infinite loop) b) No c) Yes
Is the declaration of a class its interface or its implementation?
What is a storage class? Mention the storage classes in c++.
What is an overflow error?
Explain the concept of friend function in c++?
Is it possible to use a new for the reallocation of pointers ?
What is the array and initializing arrays in c++?
What is c++ and its uses?
What is #include cmath?
What is #include c++?
what is upcasting in C++?
What are the uses of typedef in a program?