Using integer enum as a index for arrays in C# without converting?
<p>I have a large collection of data, i need to store the same in string array.</p>

<p>this array then passed into another class as callback event.</p>

<p>so i need to use index as enum values so that outside person can read the string values easily.</p>

<p>for this i tried this,</p>

<pre><code>public enum PublicData : int 
{
  CardNo = 0,
  CardName = 1,
  Address = 2,
   //etc....
}
</code></pre>

<p>then i have accessed this by,</p>

<pre><code>string[] Publicdata = new string[iLength];
Publicdata[PublicData.CardNo] =  cardNovalue;
</code></pre>

<p>but here i am getting "invalid type for index - error"</p>

<p>How to resolve the same.</p>