title: C++ Tic Tac toe game not showing X character
body: <p>Novice programmer here. Trying to make a tic tac toe game. Everything so far works, except the character X doesn't appear. In the for loop is where I believe I have a problem but I cant seem to find anything wrong. Please help, any criticism is greatly appreciated. Good and bad. Thanks.</p>
  
  <pre><code>void playgame() {
      std::string input;
  
      while (true) {
          std::cout &lt;&lt; "Go player one" &lt;&lt; std::endl;
          getline (std::cin, input);
          if (input != " ") {
              char entered = input.c_str ()[0];
  
              if (entered &gt;= '1' &amp;&amp; entered &lt;= '9') {
                  int entered_num = entered - 0;
                  int index = entered_num - 1;
                  int row = index / 3;
                  int col = index % 3;
                  char grid_position = map[row][col];
  
                  if (grid_position == 'X' || grid_position == 'O') {
                      std::cout &lt;&lt; "Space taken. Try again" &lt;&lt; std::endl;
                  } else {
                      map[row][col] = (char) 'X';
                      break;
                  }
  
              } else {
                  std::cout &lt;&lt; "Only numbers 1 - 9" &lt;&lt; std::endl;
              }
          } else {
              std::cout &lt;&lt; "Have to enter something, try again" &lt;&lt; std::endl;
          }
  
  
      }
  }
  
  void generateGrid() {
      int number = 1;
  
      for (int x = 0; x &lt; GRID_SIZE; x++) {
          for (int y = 0; y &lt; GRID_SIZE; y++) {
              map[x][y] = std::to_string (number).c_str ()[0];
              number += 1;
          }
      }
  }
  
  void tictacToeMap() {
  
  
      std::cout &lt;&lt; std::endl;
  
      for (int x = 0; x &lt; GRID_SIZE; x++) {
          for (int y = 0; y &lt; GRID_SIZE; y++) {
              std::printf (" %c ", map[x][y]);
          }
          std::cout &lt;&lt; std::endl;
      }
  
  }
  
  
  TicTacToe() {
      generateGrid ();
      while (true) {
          tictacToeMap ();
          playgame ();
      }
  }
  };
  
  
  int main() {
  
      TicTacToe tic;
  
      return 0;
  
  
  }
  </code></pre>