title: C# Can I check if an IntPtr is null?
body: <p>I have an IntPtr field in my C# class.<br>
  It holds a reference to an object in a C++ library.</p>
  
  <pre><code>protected IntPtr ThingPtr;
  </code></pre>
  
  <p>At some stage I may or may not initialise it.</p>
  
  <pre><code>ThingPtr = FunctionInMyCplusplusLibrary();
  </code></pre>
  
  <p>I'm wondering if checking whether it is null makes sense in this context (to check whether it has been intialised or not)</p>
  
  <pre><code>if(ThingPtr == null)
  {
      //Do stuff
  }
  </code></pre>