Exception handling in c++

Exception handling in C++ consists of three keywords: try, throw and catch.
* The try statement allows you to define a block of code to be tested for errors while it is being executed.
* The throw keyword throws an exception when a problem is detected, which lets us create a custom error.
* The catch statement allows you to define a block of code to be executed if an error occurs in the try block.