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 you know about structures in C++?
What is const in c++?
What are the uses of typedef in a program?
What do you mean by friend class & friend function in c++?
Is c++ a float?
Do the parentheses after the type name make a difference with new?
What is the real purpose of class – to export data?
Of the numbers 12 23 9 28 which would be at the top of a properly implemented maxheap a) 28 b) 9 c) Any of them could be
which one is equivalent to multiplying by 2:Left shifting a number by 1 or Left shifting an unsigned int or char by 1?
What are the important differences between c++ and java?
What is data binding in c++?
What is microsoft c++ redistributable?
explain the reference variable in c++?
Which format specifier is used for printing a pointer value?
Why are arrays usually processed with for loop?