title: C++ return type does not match function type
body: <p>I am getting an error 'return type does not match function type' when I am trying to return a pointer to a player in my function. The error from the compiler is:</p>
  
  <blockquote>
    <p>'&amp;' : illegal operation on bound member function expression</p>
  </blockquote>
  
  <pre><code>CPlayer* CLevel::getPlayer()
  {
  return &amp;player;
  }
  </code></pre>
  
  <p>In the header file, this is defined as:</p>
  
  <pre><code>private:
      CPlayer player(Point p, CGame* game);
  
  public:
      CPlayer* getPlayer();
  </code></pre>
  
  <p>Any ideas as to why I am getting this error and how I can remove it?</p>
  
  <p>EDIT:</p>
  
  <p>Level constructor: </p>
  
  <pre><code>CLevel::CLevel()
  {
  Point p;
  this-&gt;game=game;
  p.x=0;
  p.y=0;
  player(Point p, CGame* game) {};
  
  memset(tiles, GROUND, sizeof(TileType)*GRID_HEIGHT*GRID_WIDTH);
  }
  </code></pre>
  
  <p>Player.cpp constructor:</p>
  
  <pre><code> CPlayer::CPlayer(Point pos, CGame* game)
   {
  this-&gt;game=game;
  Point p;
  p.x=0;
  p.y=0;
  setPosition(p);
   }
  </code></pre>