title: Terminate called after throwing an instance of std::exception
body: <p>I'm new to exceptions and I tried to improve a solution for question that one of my friend had in a job interview.</p>
  
  <p>My friend was asked to build a program which will get 2 arrays and find a number, which if we divide it by the members of the first array, we will get a matching leftover of the second array.</p>
  
  <p>Can I use std::exception without any inheriting classes in this case?</p>
  
  <p>THE CPP FILE</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;exception&gt;
  #include "FindNumber.h" 
  
  
  Finder::Finder() : m_num(0)
  {}
  
  
  int Finder::FindFirst(int* _divided, int* _leftOver, int _size)
  {
      int indx = 0;
  
      while(indx &lt; _size)
      {
  
          if (!_divided[indx])
          {
              throw("Can not divide by zero!!");
          }
  
          if (m_num % _divided[indx] != _leftOver[indx])
          {
              ++m_num;
              FindRest(_divided, _leftOver, _size);
              indx = 0;
          }
  
          ++indx;
      }
  
      return m_num;
  }
  
  
  int Finder::FindRest(int* _divided, int* _leftOver, int _size)
  {
      int indx = 0;
  
      for(;;)
      {
          if (!_divided[indx])
          {
              throw("Can not divide by zero!!");
          }
  
          if (m_num % _divided[indx] != _leftOver[indx])  
          {
              ++m_num;
          }
          else
          {
              break;
          }
      }
  
      return m_num;
  }
  </code></pre>
  
  <p>THE TEST UNIT</p>
  
  <pre><code>#include &lt;cstdio&gt;
  #include &lt;iostream&gt;
  #include "FindNumber.h"
  #include "mu_test.h"
  
  #define SIZE 5
  
  /****************************** FN_check1 ******************************/
  UNIT(FN_check1) 
  
      int divided [SIZE] = {0, 4, 5, 6, 7};
      int leftOver [SIZE] = {2, 0, 3, 2, 1};
      Finder find1;
  
      try
      {   
          ASSERT_THAT(6 != find1.FindFirst(divided, leftOver, SIZE));
          ASSERT_THAT(8 == find1.FindFirst(divided, leftOver, SIZE));
      }
      catch(std::exception&amp; e)
      {
          std::cout &lt;&lt; e.what();
      }
  
  END_UNIT
  
  
  /****************************** FN_check2 ******************************/
  UNIT(FN_check2) 
  
      int divided [SIZE] = {6, 12, 8, 10, 7};
      int leftOver [SIZE] = {0, 0, 4, 2, 5};
      Finder find1;
  
  
      ASSERT_THAT(6 != find1.FindFirst(divided, leftOver, SIZE));
      ASSERT_THAT(12 == find1.FindFirst(divided, leftOver, SIZE));
  
      std::cout &lt;&lt; find1.FindFirst(divided, leftOver, SIZE) &lt;&lt; std::endl;
  
  END_UNIT
  
  
  
  
  TEST_SUITE(FindNumber_test)
  
      TEST(FN_check1)
      TEST(FN_check2)
  
  END_SUITE
  </code></pre>
  
  <p>Thanks in advance...</p>