title: How do you check for an invalid pointer?
body: <p>My current code to the effect of:</p>
  
  <pre><code>if( objectPointer != NULL){
      delete objectPointer;
  }
  </code></pre>
  
  <p>doesn't work because the pointers are getting set to invalid hex numbers by the compiler such as:</p>
  
  <ul>
  <li>0xbaadf00d </li>
  <li>0xdeadbeef</li>
  </ul>
  
  <p>etc....</p>
  
  <p>So what's the best way to check for an invalid pointer before trying to delete the object?</p>