title: Accessing 3d vector in a class c++
body: <p>So here is my simplified code.</p>
  
  <pre><code>class Game
  {
  public:
      void helper(char c);
      vector&lt;vector&lt;vector&lt;char&gt;&gt;&gt; board(5, vector&lt;vector&lt;char&gt;&gt;(10, vector&lt;char&gt;(40)));
      Game();
  };
  
  void Game::helper(char c)
  {
      int tempY = 0;
      int tempX = 0;
      int temp1 = 0;  
      if (board[temp1][tempY][tempX] != 'c')
      {
          board[temp1][tempY][tempX] = c;
      }
  }
  int main()
  {
      Game game;
      game.helper('C');
      cout&lt;&lt;game.board[0][0][0]&lt;&lt;endl;
  }
  </code></pre>
  
  <p>And then I got 2 errors on this line:</p>
  
  <pre><code> if (board[temp1][tempY][tempX] != 'c')
  </code></pre>
  
  <p>1. error C3867: 'Game::board': non-standard syntax; use '&amp;' to create a pointer to member</p>
  
  <ol start="2">
  <li>error C2109: subscript requires array or pointer type</li>
  </ol>