title: Creating two dimensional array of class
body: <p>Hi if anybody could advise how to correctly do this. Basically I'm trying to make a class variable called Board who holds in it a two dimensional array of ChessPiece instances.</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;iostream&gt;
  #include &lt;stdlib.h&gt;
  using namespace std;
  
  class ChessPiece
  {
  public:
      char ToChar() { return '#'; };
  };
  
  class ChessBoard
  {
      int Size;   //This means board is 8x8.
      ChessPiece ** Board;
  
  public:
      ChessBoard();
      int GetSize() { return Size; };
  
      void PlotBoard();
  };
  
  ChessBoard::ChessBoard() {
      Size = 8;
      ChessPiece newBoard[Size][Size];
      Board = newBoard; //Problem here!!! How do I make Board an 8x8 array of ChessPiece?
  }
  
  void ChessBoard::PlotBoard() {
      int x, y;
      for (x = 0; x &lt; Size; x++) {
          for (y = 0; y &lt; Size; y++)
              printf("%c", Board[x][y].ToChar());
      }
  }
  
  int main()
  {
      // ChessBoard board;
      // printf("%d", board.GetSize());
      // board.PlotBoard();
  
      ChessBoard * a = new ChessBoard();
  
      return 0;
  }
  </code></pre>
  
  <p>Pretty basic thing I'm missing here really, but I can't seem to figure it out.
  Thank you!</p>