What happens if an exception is throws from an, object's
constructor and object's destructor?
Answer Posted / akshay
constructor:
the destructors of all the member objects that were
correctly created are called, then code goes to the catch
statement if any
dtors:
legally allowed, however, it should be caught within the
function. if it is not caught, then it may lead to a call to
terminate() function. this call would happen in the case
when the destructor was itself called due to stack unwinding
happening because of another exception in probably some
other function.
| Is This Answer Correct ? | 2 Yes | 2 No |
Post New Answer View All Answers
Explain pass by value and pass by reference.
Define token in c++.
What is the difference between multiple and multilevel inheritance in c++?
What are the various access specifiers in c++?
Is swift a good first language?
What is c++ similar to?
Can constructor be private in c++?
How one would use switch in a program?
How are Structure passing and returning implemented by the compiler?
Can non-public members of another instance of the class be retrieved by the method of the same class?
What is the most powerful coding language?
How does work in c++?
We all know that a const variable needs to be initialized at the time of declaration. Then how come the program given below runs properly even when we have not initialized p?
How would you use the functions randomize() and random()?
What is a pdb file?