title: Two dimensional array of objects in C++
body: <p>I am migrating a scientific code from Java to C++. Please tell me:<br></p>
  
  <p>a) What's wrong with the two functions?<br>
  b) How can I solve the problem? I can use the <code>int**</code> like a two dimensional array but not the <code>Agent**</code>. </p>
  
  <p>I receive this error: <em>"No operator = matches this operand"</em>.</p>
  
  <p>In normal C we could assign NULL to pointers. We could also use a <code>type**</code> like a two dimensional array (i.e. <code>a[i][j]</code>) (two dimensional space for <code>objectSpace</code> and <code>agentSpace</code> is allocated somewhere else).</p>
  
  <pre><code>    int** objectSpace;
      Agent** agentSpace;
  
      void Space::removeAgentAt(Point p)
      {
          agentSpace[p.x][p.y] = NULL;
      }
  
      void Space::putAgentTo(Agent agent, Point p)
      {
          agentSpace[p.x][p.y] = agent;
      }
  </code></pre>