title: pointer return by new check in C++
body: <p>What is the best way to check the pointer return by a <code>new operator</code>
  I see following type of code. Assume I have <code>class Test</code></p>
  
  <p>Type 1</p>
  
  <pre><code>Test *ptr = new Test;
  if ( ptr == NULL ) {
  }
  </code></pre>
  
  <p>Type 2</p>
  
  <pre><code>Test *ptr = new Test;
  if ( !ptr ) {
  }
  </code></pre>
  
  <p>Type 3</p>
  
  <pre><code>Test *ptr = new Test;
  if ( ptr == (Test*)0 ) {
  }
  </code></pre>