Skip to content

Latest commit

 

History

History
22 lines (14 loc) · 936 Bytes

Exception.md

File metadata and controls

22 lines (14 loc) · 936 Bytes
layout title nav_order has_children
default
Exception
22
true

C++ Exception Handling

Exception Handling in C++ is a process to handle runtime errors. We perform exception handling so the normal flow of the application can be maintained even after runtime errors.

In C++, exception is an event or object which is thrown at runtime. All exceptions are derived from std::exception class. It is a runtime error which can be handled. If we don't handle the exception, it prints exception message and terminates the program.

Advantage

It maintains the normal flow of the application. In such case, rest of the code is executed even after exception.

C++ Exception Classes

In C++ standard exceptions are defined in class that we can use inside our programs. The arrangement of parent-child class hierarchy is shown below: