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
How many types of scopes are there in c++?
What is the use of data hiding?
What is a pointer how and when is it used?
Is java a c++?
What are pointers used for c++?
If a function doesn’t return a value, how do you declare the function?
What are the defining traits of an object-oriented language?
What is iterator c++?
How would you implement a substr() function that extracts a sub string from a given string?
Why do we need pointers?
Why do we need templates?
What are the syntactic rules to be avoid ambiguity in multiple inheritance?
What is constructor and destructor in c++?
What are c++ storage classes?
How do I tokenize a string in c++?