Exception Handling

This is a discussion on Exception Handling within the C++ Programming forums, part of the General Programming Boards category; Pl confirm if following statements are true. 1. When exception is thrown and not caught, destructor is called during stack ...

  1. #1
    Registered User
    Join Date
    Nov 2006
    Posts
    61

    Exception Handling

    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.

  2. #2
    The larch
    Join Date
    May 2006
    Posts
    3,573
    Smells like homework. What is your answer?

    P.S, these statements appear not to be true.
    I might be wrong.

    Thank you, anon. You sure know how to recognize different types of trees from quite a long way away.
    Quoted more than 1000 times (I hope).

  3. #3
    Registered User
    Join Date
    Nov 2006
    Posts
    61
    Can you justfity? This is not homework but fundu questions. Pl answer

  4. #4
    verbose cat
    Join Date
    Jun 2003
    Posts
    209
    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.
    abachler: "A great programmer never stops optimizing a piece of code until it consists of nothing but preprocessor directives and comments "

  5. #5
    Malum in se abachler's Avatar
    Join Date
    Apr 2007
    Posts
    3,189
    Until you can build a working general purpose reprogrammable computer out of basic components from radio shack, you are not fit to call yourself a programmer in my presence. This is cwhizard, signing off.

  6. #6
    Algorithm Dissector iMalc's Avatar
    Join Date
    Dec 2005
    Location
    New Zealand
    Posts
    6,308
    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...?
    My homepage
    Advice: Take only as directed - If symptoms persist, please see your debugger

    Linus Torvalds: "But it clearly is the only right way. The fact that everybody else does it some other way only means that they are wrong"

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. signal handling and exception handling
    By lehe in forum C++ Programming
    Replies: 2
    Last Post: 06-15-2009, 11:01 PM
  2. Exception handling in a large project
    By EVOEx in forum C++ Programming
    Replies: 7
    Last Post: 01-25-2009, 07:33 AM
  3. exception handling
    By coletek in forum C++ Programming
    Replies: 2
    Last Post: 01-12-2009, 05:28 PM
  4. is such exception handling approach good?
    By George2 in forum C++ Programming
    Replies: 8
    Last Post: 12-27-2007, 08:54 AM
  5. Signal and exception handling
    By nts in forum C++ Programming
    Replies: 23
    Last Post: 11-15-2007, 02:36 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21