title: Bad allocation exceptions in C++
body: <p>In a school project of mine, I was requested to create a program without using <strong>STL</strong></p>
  <p>In the program, I use a lot of</p>
  <pre><code>Pointer* = new Something;
  if (Pointer == NULL) throw AllocationError();
  </code></pre>
  <p><em>My questions are about allocation error:</em></p>
  <ol>
  <li>is there an <strong>automatic exception</strong> thrown by <code>new</code> when allocation fails?</li>
  <li>if so, how can I catch it if I'm not using <strong>STL</strong> (<code>#include &quot;exception.h&quot;</code>)?</li>
  <li>is <code>NULL</code> testing enough?</li>
  </ol>
  <p>Thank You.<br />
  I'm using <em><strong>eclipseCDT(C++)</strong></em> with <em><strong>MinGW</strong></em> on <em><strong>Windows 7</strong></em>.</p>