title: C# Iterating through an enum? (Indexing a System.Array)
body: <p>I have the following code:</p>
  
  <pre><code>// Obtain the string names of all the elements within myEnum 
  String[] names = Enum.GetNames( typeof( myEnum ) );
  
  // Obtain the values of all the elements within myEnum 
  Array values = Enum.GetValues( typeof( myEnum ) );
  
  // Print the names and values to file
  for ( int i = 0; i &lt; names.Length; i++ )
  {
      print( names[i], values[i] ); 
  }
  </code></pre>
  
  <p>However, I cannot index values. Is there an easier way to do this? </p>
  
  <p>Or have I missed something entirely!</p>