Exception Handling Flashcards
What is an indication of a problem that occurs during program’s execution?
An exception
What does exception handling do?
Creates applications to resolve exceptions, perform cleanup, notify, and terminate programs
What virtual function does class exception provide to return error message?
what
Which header defines runtime_error?
<stdexcept>
</stdexcept>
What is the termination model of exception handling used by C++?
Control resumes to first statement after catch handler following try block
What is a try block?
Defines a block of code in which exceptions might occur
What follows a try block?
Atleast one catch handler
What do you call the point in the program at which an exception occurs?
Throw point
If exception occurs in a try block, try block expires and control transfers to first….
Catch with same parameter type
Catch handlers should be in what order?
Most specific to least specific
Stack unwinding?
Program terminates function and tries to locate try block in calling function when try has no catch
Exception object
When operand of a throw is an object
When exception handlers defers exception handling to another exception handler
Rethrowing the exception
Common types of exceptions?
Out of range array subscripts
Arithmetic overflow
Division by zero
Invalid function parameters
Unsuccessful memory allocations
Stack unwinding
Function where exception was not terminates and control returns to statement originally invoked