title: 2d array index out of range exception
body: <p>As soon as i enter the while loop the program throws Index out of range exception, without getting rows and columns value. getint is a method to get user input while making sure the values are in range</p>
  
  <pre><code> while(filled&gt;0)
          {
              row = getint("row:  ");
              row--;
              column = getint("column:  ");
              column--;
              fields[row, column]=getint("value:  ");
              filled--;
          }
  </code></pre>
  
  <p>edit:</p>
  
  <pre><code>static int getint(string question)
      {
          string temp;
          int tempint=0;
          while (check != 0)
          {
              check = 0;
              Console.Write("\nPlease enter the {0}",question);
              temp = Console.ReadLine();
              if(!int.TryParse(temp, out tempint))
              {
                  check++;
              }
              if(question.Length&lt;14 &amp; (tempint&lt;1 | tempint&gt;9))
              {
                  check++;
                  Console.WriteLine("Invalid Input");
              }
          }
          return tempint;
      }
  </code></pre>