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
Write a Program for read a line from file from location N1 to N2 using command line arguments. Eg:exe 10 20 a.c
How do you instruct your compiler to print the contents of the intermediate file showing the effects of the preprocessor?
What is the difference between the functions rand(), random(), srand() and randomize()?
What do you mean by function and operator overloading in c++?
What is main function in c++ with example?
Can I uninstall microsoft c++ redistributable?
What is the difference between structures and unions?
Is c++ fully object oriented?
Does c++ have string data type?
what is pre-processor in C++?
Should I learn c++ c?
Why is c++ difficult?
What are its advantages and disadvantages of multiple inheritances (virtual inheritance)?
What is scope operator in c++?
Describe linkages and types of linkages?