I
Ian Semmel
If I have
Enum en
{
i1,
i2,
i3
}
I reckon I should be able to have
int[] v = new int [ en ];
It is obvious what I want to do, but the compiler doesn't like it.
The only way I know to do it is (is there a better way?)
v = new int[ Enum.GetValues( typeof ( en) ).GetLength (0) ];
Enum en
{
i1,
i2,
i3
}
I reckon I should be able to have
int[] v = new int [ en ];
It is obvious what I want to do, but the compiler doesn't like it.
The only way I know to do it is (is there a better way?)
v = new int[ Enum.GetValues( typeof ( en) ).GetLength (0) ];