What happens if an exception is throws from an object's
constructor and from object's destructor?
Answers were Sorted based on User's Feedback
Answer / rajesh
exception from object's destructor - could terminate the
program while stack unwinding.
| Is This Answer Correct ? | 2 Yes | 0 No |
Answer / achal ubbott
If an exception is generated by constructor of the class
that object is not created. That means if you do
delete obj_ptr;
the destructor would not be called.
| Is This Answer Correct ? | 1 Yes | 0 No |
Answer / reegan
if an exception is throws from object constructor, it is
caught by catch block .the same thing is happen in the objects
destructor.
| Is This Answer Correct ? | 1 Yes | 3 No |
What is pointer to array in c++?
What is the difference between a copy constructor and an overloaded assignment operator?
4 Answers Belzabar, Citrix, Microsoft, Wipro,
how to swap two strings without using any third variable ?
Is it possible to write a c++ template to check for a function's existence?
How can you specify a class in C++?
Perform addition, multiplication, subtraction of 2-D array using Operator Overloading.
Can we use this pointer in a class specific, operator-overloading function for new operator?
What is c++ & why it is used?
What are proxy objects?
Is c++ platform dependent?
class basex { int x; public: void setx(int y) {x=y;} }; class derived : basex {}; What is the access level for the member function "setx" in the class "derived" above? a) private b) local c) global d) public e) protected
What is time_t c++?