title: Error : Index was outside the bounds of the array.
body: <p>I'm aware of what the issue is stating but I am confused to how my program is outputting a value that's outside of the array..</p>
  
  <p>I have an array of ints which is 0 - 8 which means it can hold 9 ints, correct?
  I have an int which is checked to make sure the users input value is 1-9. I remove one from the integer (like so)</p>
  
  <pre><code>if (posStatus[intUsersInput-1] == 0) //if pos is empty
  {
      posStatus[intUsersInput-1] += 1; 
  }//set it to 1
  </code></pre>
  
  <p>then I input 9 myself and I get the error. It should access the last int in the array, so I don't see why I'm getting an error. 
  Relevant code:</p>
  
  <pre><code>public int[] posStatus;       
  
  public UsersInput()    
  {    
      this.posStatus = new int[8];    
  }
  
  int intUsersInput = 0; //this gets try parsed + validated that it's 1-9    
  
  if (posStatus[intUsersInput-1] == 0) //if i input 9 it should go to 8?    
  {    
      posStatus[intUsersInput-1] += 1; //set it to 1    
  } 
  </code></pre>
  
  <p>Error:</p>
  
  <pre><code>"Index was outside the bounds of the array." "Index was outside the bounds of the array."
  </code></pre>