2 What is an exception?

The concept of “exception” is not unique to C++. Most object oriented programming languages, including Perl and Visual Basic, have built-in language constructs to handle exception.

An exception is a condition that “really should not be true” under normal program execution conditions. For example, running out of heap space for dynamically memory allocation is such a condition.

Generally speaking, if there is a way to get around a problem and continue program execution, the problem is not an exception. An exception is a problem that leads to the abortion of execution. Often, the abortion of execution is not limited to the subroutine that detects the problem, but also many levels of invocations before it.