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
What is a null object in c++?
Define pure virtual function?
What is enum c++?
How long it will take to learn c++?
What is the protected keyword used for?
Does there exist any way to make the command line arguments available to other functions without passing them as arguments to the function?
Explain the operation of overloading of an assignment operator.
Write a corrected statement in c++ so that the statement will work properly. if (4 < x < 11) y=2*x;
Is c++ harder than java?
What is rvalue?
Is c better than c++?
You want to link a c++ program to c functions. How would you do it?
Why are arrays usually processed with for loop?
If you don’t declare a return value, what type of return value is assumed?
What are c++ tokens?