is throwing exception from a constructor not a good practice ?

Answer Posted / shwetha.v.g

Actualy though when an object is created memory will b
allocated but the process of allocation of memory will be
complete only if conytructor is successfully invoked so if
constructor throws an exception memory will not be
allocated for that object.

Is This Answer Correct ?    1 Yes 6 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why would you use pointers in c++?

713


What c++ library is string in?

690


How would you use the functions randomize() and random()?

728


Can you please explain the difference between overloading and overriding?

708


Define pointers?

698






What can I use instead of namespace std?

739


Explain how we implement exception handling in c++?

667


What you know about structures in C++?

684


What is meant by entry controlled loop? What all C++ loops are exit controlled?

680


how to explain our contribution in the project?

3208


Can recursive program be written in C++?

732


What is #include sstream?

707


Explain how the virtual base class is different from the conventional base classes of the opps.

792


What is iterator c++?

630


Is java the same as c++?

627