- In C++ exception handling is a process to handle runtime errors.
- If we perform exception handling, so the normal flow of the application can be maintained even after runtime errors.
- At run time exception is an event or object which is thrown in C++ and all exceptions are derived from std::exception class.
- It prints exception message and terminates the program, if we don’t handle the exception.
- In C++ exception handling consists of three keywords, they are try, throw, catch
- In exception handling try keyword allows you to define a block of code to be tested for errors when it is being executed.
- In exception handling throw keyword throws an exception when a problem is detected, which lets us create a custom error.
- In exception handling catch keyword allows you to define a block of code to be executed, if an error occurs in the try block.
W