title: Exception Handling in C++ Terminate called after throwing an instance of 'char const*'
body: <p>Error : Terminate called after throwing an instance of 'char const*'</p>
  
  <p>terminate application has been required the Runtime to terminate it in an unusual way. Please contact the application's support team.</p>
  
  <p>I'm not sure what's causing the compiler to crash when I do this. Any ideas? A bit new to programming.</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;iomanip&gt;
  
  using namespace std;
  
  //Template for Maximum
  
  template &lt;class X&gt;
  X Maximum(X arg1, X arg2)
  {
      if (arg1 &gt; arg2)
          return arg1;
      else
          return arg2;
  }
  
  //Template for Minimum
  
  template &lt;class M&gt;
  M Minimum(M arg1, M arg2)
  {
      if (arg1 &gt; arg2)
          return arg2;
      else
          return arg1;
  }
  
  /* Template for Divide(D arg1, D arg2) arg1: the dividend arg2: the divisor Description: 
  Divides arg1 by arg2. If arg2 equals zero then an exception is thrown. */
  
  template &lt;class D&gt;
  D Divide(D arg1, D arg2)
  {
      if (arg2 == 0) {
          throw "You cannot devide by zero! ";
      }
      return (arg1 / arg2);
  }
  
  int main()
  {
  
      int a, b;
      float c, d;
      double e, f;
      a = 2;
      b = 22;
      cout &lt;&lt; setprecision(4) &lt;&lt; fixed &lt;&lt; showpoint &lt;&lt; "min:" &lt;&lt; Minimum(a, b) &lt;&lt; "\tmax: " &lt;&lt; Maximum(a, b) &lt;&lt; endl;
      c = 4.7f;
      d = 2.97f;
      cout &lt;&lt; setprecision(4) &lt;&lt; fixed &lt;&lt; showpoint &lt;&lt; "min:" &lt;&lt; Minimum(c, d) &lt;&lt; "\tmax: " &lt;&lt; Maximum(c, d) &lt;&lt; endl;
  
      e = 387.78;
      f = 387.7798;
      cout &lt;&lt; setprecision(4) &lt;&lt; fixed &lt;&lt; showpoint &lt;&lt; "min:" &lt;&lt; Minimum(e, f) &lt;&lt; "\tmax: " &lt;&lt; Maximum(e, f) &lt;&lt; endl;
      e = 40;
      f = 0;
      try {
          cout &lt;&lt; setprecision(4) &lt;&lt; fixed &lt;&lt; showpoint &lt;&lt; "Divide: " &lt;&lt; e &lt;&lt; '/' &lt;&lt; f &lt;&lt; " = " &lt;&lt; Divide(e, f) &lt;&lt; endl;
      }
      catch (string exceptionString) {
          cout &lt;&lt; exceptionString;
      }
      system("pause");
      return 0;
  }
  </code></pre>