Login | Register   
LinkedIn
Google+
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


Tip of the Day
Language: C++
Expertise: Intermediate
May 7, 1999

Unwinding the Stack

When an exception is thrown, the runtime mechanism first searches for an appropriate handler (a catch statement) for it in the current scope. If such a handler does not exist, the current scope is exited and the function that is higher in the calling chain is entered into scope. This process is iterative; it continues until an appropriate handler has been found. An exception is considered to be handled upon its entry to a handler. At this point, all the local objects that were constructed on the path from a try block to a throw-expression have been destroyed. In other words, the stack has been unwound.
Danny Kalev
 
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap