Exception, usually refersProgramIt may be detected that the operation is abnormal, such as Division by 0, out-of-bounds access to the array, and memory depletion. The exception handling syntax is usually
Try
{
Throw()
}
Catch ()
{
}
The keyword try and the content in braces after it are called try blocks. Simply put, it contains the places where errors may occur (that is, the places we want to detect ). When an error message is detected, throw the keyword throw. What should we do? Where can I leave it? Our catch keyword solves this problem for us. Catch is usually used to receive exceptions thrown by throw. Note that the type thrown by throw must match the type accepted by catch.
Throw expressions act like function calls, while catch Clauses Act Like function definitions. One of the main differences between the two mechanisms is:All the information required to create a function call is obtained at the time of compilation, but the exception handling mechanism is not. C ++ exception handling requires runtime support.
Http://www.cnblogs.com/8586/archive/2009/05/28/1491288.html
Catch (...) can catch all types of exceptions.