title: How to change a value in an array C++
body: <p>This function is for code to play a game of tic tac toe:</p>
  
  <pre><code>//--------------------FUNCTION--------------------
  
  bool playCell(int player, int position, int gameBoard[]) {
  
      if (gameBoard[position] == 10 || gameBoard[position] == 11) {
          return false;   
      } else {
          return true;
          if (player == 0){
              gameBoard[position] = 10;
          } else {
              gameBoard[position] = 11;
          } // end if
      }
  } // end function 
  </code></pre>
  
  <p>playCell takes a player (0 for "O", 1 for "X"), a position (1 to 9), and the nine element gameBoard, and returns true if the move is legal (i.e. that spot is not yet taken), and false otherwise.  If the move is legal it changes the position to that players number (10 for "O", 11 for "X"). If the player or position input is invalid, it returns false.</p>
  
  <p>I'm trying to figure out how to get the array to change its value to either a 10 or 11 depending on the player, and saving to the position they entered to play in.</p>