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



What happens if an exception is throws from an object's constructor and from object's de..

Answer / rajesh

exception from object's destructor - could terminate the
program while stack unwinding.

Is This Answer Correct ?    2 Yes 0 No

What happens if an exception is throws from an object's constructor and from object's de..

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

What happens if an exception is throws from an object's constructor and from object's de..

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

Post New Answer



More C++ General Interview Questions

Who was the creator of c++?

0 Answers  


what is difference between internet and Internet?

12 Answers   TCS, Microsoft, College School Exams Tests, MIT,


Why do we need constructors in c++?

0 Answers  


Floating point representation and output seems to be compiler dependent?

1 Answers  


CAN U SAY WHICH PROGRAMING LANGUAGE IS USED BY DOCTORS....?

1 Answers  






total amount of milk produced each morning and then calculates and outputs the number of cartons needed for this milk , the cost of producing the milk and the profit from producing this milk.

0 Answers  


What are the operators in c++?

0 Answers  


Explain public, protected, private in c++?

0 Answers  


What are static and dynamic type checking?

0 Answers  


declare an array of structure where the members of the structure are integer variable float variable integer array char variable access all elements of the structure using dot operator and this pointer operator

0 Answers  


Write a program which is required to process the time of a clock in hours and minutes, entered from the keyboard. With this program, there are two requirements for any data entered by a user: 1. The data must be of the correct type (in this case, two ints). 2. The data must be in the correct range: this means that, for the minutes, negative numbers and any number above 59 must be rejected; for the hours, negative numbers and any number above 23 must be rejected. Output error message for invalid data input. Output the time one and a half hour after the time input. i.e. Hour: 22 Min: 32 One and a half hour after 22:32 is 00:02

0 Answers  


Can we define function inside main in c++?

0 Answers  






Categories