title: Difference between using try-Catch exception handler and if else condition check?
body: <p>I have used in many places <code>if...else</code> statements, however I'm new to exception handling. What is the main difference among these two?</p>
  <p>for eg:</p>
  <pre><code> int *ptr = new (nothrow) int[1000];
   
   if (ptr == NULL) {
       // Handle error cases here...
   }
  </code></pre>
  <p>OR</p>
  <pre><code>  try
    {
      int* myarray= new int[1000];
    }
    catch (exception&amp; e)
    {
      cout &lt;&lt; &quot;Standard exception: &quot; &lt;&lt; e.what() &lt;&lt; endl; 
    }
  </code></pre>
  <p>So we are using here standard class for exception which has some in build function like <code>e.what()</code>. So it may be advantage. Other than that all other functionality handling we can do  using <code>if...else</code> also. Is there any other merits in using exception handling?</p>