title: Error 1 Cannot apply indexing with [] to an expression of type 'int'
body: <p>I am using Microsoft Visual Studio 2010 and C#. This is a function that is being called form elsewhere in my console program, but I can't seem to get input into the array <code>ipoints</code>. </p>
  
  <pre><code>static void GetPoints(int ipoints, string srestaurant)
  {
      int index = 0;
      int iinput;
      for (index = 0; index &lt; 5; index++)
      {
          Console.Write("please enter how many points " + srestaurant[index] + " got : ");
          iinput = Convert.ToInt32(Console.ReadLine());
  
          while (iinput &lt; 0 &amp;&amp; iinput &gt; 20)
          {
              Console.Write("please enter how many points " + srestaurant[index] + " got : ");
              iinput = Convert.ToInt32(Console.ReadLine());
          }
          ipoints[index] = iinput;
      }
  }
  </code></pre>