title: Tic Tac Toe program: expected identifier and expected constant errors
body: <p>I have a tic tac toe game worked up here, but i keep getting these errors:</p>
  
  <p>[Error] expected declaration before '}' token</p>
  
  <p>[Error] expected unqualified-id before numeric constant</p>
  
  <p>[Error] expected '}' before numeric constant</p>
  
  <p>[Error] expected identifier before numeric constant</p>
  
  <pre><code>#include &lt;iostream&gt; 
  #include &lt;string&gt; 
  using std::string; 
  
  enum SquareState{ blank = ' ', X = 'X', 0 = '0'};
  
  class Board{
      private: 
          const int HEIGHT;
          const int WIDTH;
          int* gboard;
      public:
          Board() : WIDTH(3), HEIGHT(3)
          {
              gboard = new int[9];
              for (int i = 0; i &lt; 9; i++)
                  *(gboard+i) = blank;
          }
  
          Board() {delete[] gboard;}
          void setX(int h, int w);
          void set0(int h, int w);
          bool isTaken(int h, int w);
          SquareState isLine();
          void draw();
  };
  
  void Board::setX(int h, int w)
  {
      *(gboard + h*HEIGHT + w) = X;
  }
  void Board::set0(int h, int w)
  {
      *(gboard + h*HEIGHT + w) = 0;
  }
  bool Board::IsTaken(int h, int w)
  {
      return *(gboard + h*HEIGHT + w) != ' ';
  }
  SquareState Board::IsLine()
  {
      if(*gboard==X &amp;&amp; *(gboard +1)==X &amp;&amp; *(gboard +2)==X)
          return X;
      if(*gboard==0 &amp;&amp; *(gboard +1)==0 &amp;&amp; *(gboard +2)==0)
          return 0;
      if(*(gboard+3)==X &amp;&amp; *(gboard +4)==X &amp;&amp; *(gboard +5)==X)
          return X;
      if(*(gboard+3)==0 &amp;&amp; *(gboard +4)==0 &amp;&amp; *(gboard +5)==0)
          return 0;
      if(*(gboard+6)==X &amp;&amp; *(gboard +7)==X &amp;&amp; *(gboard +8)==X)
          return X;
      if(*(gboard+6)==0 &amp;&amp; *(gboard +7)==0 &amp;&amp; *(gboard +8)==0)
          return 0;
      if(*gboard==X &amp;&amp; *(gboard +3)==X &amp;&amp; *(gboard +6)==X)
          return X;
      if(*gboard==0 &amp;&amp; *(gboard +3)==0 &amp;&amp; *(gboard +6)==0)
          return 0;
      if(*(gboard+1)==X &amp;&amp; *(gboard +4)==X &amp;&amp; *(gboard +7)==X)
          return X;
      if(*(gboard+1)==0 &amp;&amp; *(gboard +4)==0 &amp;&amp; *(gboard +7)==0)
          return 0;
      if(*(gboard+2)==X &amp;&amp; *(gboard +5)==X &amp;&amp; *(gboard +8)==X)
          return X;
      if(*(gboard+2)==0 &amp;&amp; *(gboard +5)==0 &amp;&amp; *(gboard +8)==0)
          return 0;
      if(*gboard==X &amp;&amp; *(gboard +4)==X &amp;&amp; *(gboard +8)==X)
          return X;   
      if(*gboard==0 &amp;&amp; *(gboard +4)==0 &amp;&amp; *(gboard +8)==0)
          return 0;
      if(*(gboard+2)==X &amp;&amp; *(gboard +4)==X &amp;&amp; *(gboard +6)==X)
          return X;
      if(*(gboard+2)==0 &amp;&amp; *(gboard +4)==0 &amp;&amp; *(gboard +6)==0)
          return 0;
  
      return blank;
  }
  void Board::draw()
  {
      using std::cout;
  cout &lt;&lt; "\n"
  for (int i = 0; i &lt;HEIGHT; i++){
      cout &lt;&lt; (char)*(gameboard + i*HEIGHT);
      for (int c = 1; c &lt; WIDTH; c++);
          cout &lt;&lt; " | " &lt;&lt; (char)*(gameboard + i*WIDTH + c);
      cout &lt;&lt; "\n" &lt;&lt; "------" &lt;&lt; "/n";
  }
  class Game
  {
      public:
          Board* doInput(string player, gboard * gb);
          bool inRange (int test);
  };
  
  Board* Game::doInput(string player, Board* gb)
  {
      using std::cout;
      using std::cin;
  
      gb-&gt;draw();
      string letter;
      if(player.compare("one")==0)
          letter = "X";
      else if (player.compare("two")==0)
          letter = "0";
      else return gb;
  
      int input1, input2;
      do{
          do{
              cout &lt;&lt; "\nplayer" &lt;&lt; player.c_str()
                  &lt;&lt; ", choose a row to put an "
                  &lt;&lt; letter.c_str() &lt;&lt; ": ";
              cin &gt;&gt; input1;
          }while(!inRange(input1));
          do{
              cout &lt;&lt; "\nplayer" &lt;&lt; player.c_str()
                  &lt;&lt; ", choose a column to put an "
                  &lt;&lt; letter.c_str() &lt;&lt; ": ";
              cin &gt;&gt; input2;  
          }while(!inRange(input2));
      }while (gb-&gt;isTaken(input1, input2));
  
      if (player.compare("one")==0)
          gb-&gt;setX(input1, input2);
      else
          gb-&gt;set0(input1, input2);
      return gb;
  }
  
  bool Game::inRange(int test)
  {
      return test &gt; -1 &amp;&amp; test &lt; 3;
  }
  
  int main(void)
  {
      using std::cout;
      using std::cin;
  
      Board* gb = new Board;
      Game g;
      string player1, player2;
      cout&lt;&lt; "Let's play some Triple-T"
          &lt;&lt;"\nplayer one, introduce yourself: ";
      cin &gt;&gt; player1;
      cout &lt;&lt; "\nplayer two, introduce yourself: ";
      cin &gt;&gt; player2;
  
      while (gb-&gt;isLine()== ' ')
      {
          gb = g.doInput("one", gb);
          gb = g.doInput("two", gb);
      } 
      gb-&gt;draw();
      if (gb-&gt;isLine()==X)
          cout&lt;&lt; "\nplayer one has prevailed\n";
      else 
          cout&lt;&lt; "\nplayer one has prevailed\n";
      return 0;
  }//end main
  </code></pre>