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

What is function overriding in c++?

601


How do I tokenize a string in c++?

606


What are friend classes? What are advantages of using friend classes?

603


What is general form of pure virtual function? Explain?

506


What are static variables?

615






Will c++ be replaced?

543


What are iterators in c++?

589


Which c++ compiler is best?

580


What is the use of pointer in c++ with example?

557


What are the advantages of c++ over c?

580


why is iostream::eof inside a loop condition considered wrong?

587


How will you call C functions from C ++ and vice-versa?

653


write a corrected statement in c++ so that the statement will work properly. x = y = z + 3a;

1453


How does work in c++?

592


Is c++ the hardest programming language?

634