title: Test for a null pointer value in C++
body: <p>It's not clear for me how can i do that in C++. In Objective-C I can check a object in this way </p>
  
  <pre><code>if (myValue != [NSNull null]) { … }
  </code></pre>
  
  <p><code>myValue</code> is compared with a null object (returned by class method), so this works great , if object has a value, even nil, <code>if</code> statement will return <code>true</code>.</p>
  
  <p>So question is how to test correctly for a null pointer value, i did this way </p>
  
  <pre><code>if (myValue != NULL)
  {
      qDebug() &lt;&lt; "It is not null";
  }
  </code></pre>
  
  <p>but it is not working.</p>