title: c# For loop through 2D array exception unhandled, Index out of bounds
body: <p>Apologies for the beginner question but I am struggling to find an answer as to why I get an exception unhandled error after the first For loop. It runs through the loop once, asking me the three questions, and then the program stops. C#</p>
  
  <p>(I am trying to teach myself as my teachers aren't going through much at all, so sorry again)</p>
  
  <pre><code>Console.WriteLine("How many people do you have to enter?");
          int numPeople = int.Parse(Console.ReadLine());
          string[,] data = new string[numPeople,2];
  
          for (int i = 0; i &lt; numPeople; i++)
          {
              Console.WriteLine("Enter a Name:");
              data[i,0] = Console.ReadLine();
              Console.WriteLine("Enter " + data[i,0] +"'s Age:");
              data[i,1] = Console.ReadLine();
              Console.WriteLine("Enter " + data[i,0] + "'s class:");
              data[i,2] = Console.ReadLine();
          }
  
          for (int v = 0; v &lt; numPeople; v++)
          {
              for (int x = 0; x &lt; 3; x++)
              {
                  Console.WriteLine(data[v,x] + "\t");
              }
          }
          Console.ReadLine();
  </code></pre>