try-catch in C++

The catch blocks for a try block are ran in order of appearance. Note: This makes it possible to write handlers that can never be executed, for example by placing a handler for a final derived class after a handler for a corresponding unambiguous public base class.
* There is a special catch block called the ‘catch all’ block, written as catch(…), that can be used to catch all types of exceptions. 
* In catch blocks, implicit type conversion doesn’t happen for primitive types. 
* If an exception is thrown and not caught anywhere, the program terminates abnormally. 
* A derived class exception should be caught before a base class exception. 
* the C++ library has a standard exception class which is the base class for all standard exceptions. All objects thrown by the components of the standard library are derived from this class. Therefore, all standard exceptions can be caught by catching this type.
* In C++, all exceptions are unchecked, i.e., the compiler doesn’t check whether an exception is caught or not. So, it is not necessary to specify all uncaught exceptions in a function declaration. Although it’s a recommended practice to do so. 
*  In C++, try/catch blocks can be nested. Also, an exception can be re-thrown using “throw; “.
* When an exception is thrown, all objects created inside the enclosing try block are destroyed before the control is transferred to the catch block.
```
#include <iostream>
using namespace std;

double division(int a, int b) {
   if( b == 0 ) {
      throw "Division by zero condition!";
   }
   return (a/b);
}

int main () {
   int x = 50;
   int y = 0;
   double z = 0;
 
   try {
      z = division(x, y);
      cout << z << endl;
   } catch (const char* msg) {
     cerr << msg << endl;
   }

   return 0;
}
```