Understanding exception handling
Error conditions may occur within an application that would prevent a program from continuing correctly. Such error conditions may include data values that exceed application limits, necessary input files or databases have become unavailable, heap memory has become exhausted, or any other imaginable issue. C++ exceptions provide a uniform, language-supported manner for handling program anomalies.
Prior to the introduction of language supported exception handling mechanisms, each programmer would handle errors in their own manner, and sometimes not at all. Program errors and exceptions that are not handled imply that somewhere further in the application, an unexpected result will occur and the application will most often terminate abnormally. These potential outcomes are certainly undesirable!
C++ exception handling provides a language supported mechanism to detect and correct program anomalies so that an application can remain running, rather...