title: c++ how to handle with generic exception object all types of exceptions?
body: <p>In my app Im using different open source libraries , that throws different exceptions .
  I don’t have experience in dealing in way with exception handling ,I always just did the try/catch thing , when I know<br>
  there is problem . 
  Now I like to build some kind of object that handles all exceptions inside it . and I don’t have idea how to start and even if it possible<br>
  For example I have my class A and B  </p>
  
  <pre><code>Class A 
  {
   void method1() 
  {
    Foo foo = new foo // external lib throws throw std::bad_alloc();
  }
  };
  
  Class B 
  {
   Void method1() 
  {
    Int d = m_foo[0] // external lib  throw std::runtime_error( message );
  }
  };
  </code></pre>
  
  <p>I want somehow to handle those kinds and others in central place in my application 
  What strategy should I use ?</p>
  
  <p><strong>UPDATE :</strong><br>
  after trying the suggestion offered and implemented the try/catch in the main of my application , the problem it never gets there when the exception throws all im getting is this but its never gets to the try/catch:<br>
  <img src="https://i.stack.imgur.com/i7FJn.jpg" alt="visual studio run time error"></p>