Pl confirm if following statements are true.
1. When exception is thrown and not caught, destructor is called during stack undwinding.
2. When exception is thrown , destructor is called.
3. When exception is thrown and not caught, first unexpected() method is called.If set_unexpected is not set then, terminate method is called which calls abort method if method set_terminate() is not set.
4. stack unwinding involves releasing memory allocated on heap as well as memory allocated on stact for variables like int a.
Please explain if above 4 statements or any of the statement is not correct. verify..thanks in advance.
Smells like homework. What is your answer?
P.S, these statements appear not to be true.
Can you justfity? This is not homework but fundu questions. Pl answer
Well, if it isn't homework then you have all the time in the world to research the answers.
Google for exceptions, destructor, stack unwinding, etc. and I'm sure you will find what you are looking for.
It doesn't matter what you tell us your reason for wanting the answers is. There are only two possibilites:
It is homework -> Answer equals STFW!
It isn't homework and you actually want to learn about this for your own bennefit -> Answer equals STFW!
Well, what are you waiting for...?