title: C# Reading each value of a returned array
body: <p>I have an array being returned but as I'm new to programming I can't work out how to read each value. Can someone please point me in the right direction?</p>
  
  <p>My code is below.</p>
  
  <pre><code>private void testToolStripMenuItem_Click(object sender, EventArgs e)
  {
   foreach (int name in getNames()) //&lt;----I'm wrong here I guess
   {
      MessageBox.Show(name.ToString());
   }
  }
  
  private ArrayList getNames()
  {
   //some code...
   ..
   ...
   return names;
  }
  </code></pre>
  
  <p>Thanks all</p>