title: Introductory C++ course assignment: Tic-Tac-Toe; Errors when setting up array
body: <p>So, the project is to make a tic-tac-toe game.  This is supposed to be VERY basic, as it is a fundamentals of programming course (bottom-line intro level).  I say this because any help I may receive cant be beyond my scope of knowledge or it will seem fishy.</p>
  
  <p>I need the numbers displayed on the board (each space for X and O will have a place holding number of 1 - 9) to be pulled from an array I have set up.  The issue is, I can't get it to do this in the fashion I would like.</p>
  
  <p>So, with the help of the comments below I have cleaned up my code a bit (this is the reason for the edits and may be why the questions and answers don't match up).</p>
  
  <p>The current issue I'm having is that I don't know how to allow the user to change the number to an 'X' or an 'O'.  </p>
  
  <pre><code>using namespace std;
  
  int board[9] {
      1, 2, 3, 4, 5, 6, 7, 8, 9
  };
  
  void displayBoard(void) {
  char index;
      for (int i=0; i &lt; 9; i++)
      cout &lt;&lt; endl;
      cout &lt;&lt; board[index] &lt;&lt; "|" &lt;&lt; board[index+1] &lt;&lt; "|";  cout &lt;&lt; board[index+2] &lt;&lt; endl;
      cout &lt;&lt; "-----" &lt;&lt; endl;
      cout &lt;&lt; board[index+3] &lt;&lt; "|" &lt;&lt; board[index+4] &lt;&lt; "|" &lt;&lt; board[index+5] &lt;&lt; endl;
      cout &lt;&lt; "-----" &lt;&lt; endl;
      cout &lt;&lt; board[index+6] &lt;&lt; "|" &lt;&lt; board[index+7] &lt;&lt; "|" &lt;&lt; board[index+8] &lt;&lt; endl;
      index = index + 9;
  
  }
  
  void playerInput(void) {
  
  
  
      for (int i=0; i &lt; 9; i++) {
          cin &gt;&gt; board[index]
      }
  }
  int main (int argc, char *argv[]) {
      displayBoard();
  
  
  }
  </code></pre>