title: Visual C++/CLI (CLR) Null pointer
body: <p>I wan't to implement the following code - the check if the pointer is null or not null. If the pointer points to object, then do sth with that object, if not - skip that code block.</p>
  
  <p>My code:</p>
  
  <pre><code>ref class EchoClient {
  private:
      GameMatrix^ gameMatrix;
  public:
      EchoClient(void);
      EchoClient(GameMatrix^);
      void do();
  };
  
  EchoClient::EchoClient(void)
  {
      this-&gt;gameMatrix = NULL;
  }
  
  EchoClient::EchoClient(gameMatrix)
  {
      this-&gt;gameMatrix = gameMatrix;
  }
  
  void EchoClient::do() {
      if(this-&gt;gameMatrix != NULL)
      {
          this-&gt;gameMatrix-&gt;redrawMatrix();
      }
  }
  </code></pre>
  
  <p>The error:</p>
  
  <pre><code>error C2446: '!=' : no conversion from 'int' to 'GameMatrix ^' k:\visual studio 2010\Projects\EchoClient3WS\EchoClient3WS\EchoClient.cpp    106
  </code></pre>
  
  <p>Any solutions ???</p>