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
Why c++ is the best language?
What are c++ manipulators?
Mention the purpose of istream class?
What is a linked list in c++?
How can a struct in c++ differs from a struct in c?
Difference between a homogeneous and a heterogeneous container
What is the use of 'this' pointer?
How the endl and setw manipulator works?
Why c++ is not a pure oop language?
What do you mean by volatile and mutable keywords used in c++?
What it is and how it might be called (2 methods).
How do I start a c++ project?
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.
How much do coding jobs pay?
What is a buffer c++?