> enum WD_INDICE {DAY,WEEK,MONTH,YEAR};
int[] wndCount = new int [ WD_INDICE] {0, 0, 0, 0};
I would like to index into the array using the enums like wndCount[DAY].
You can't do that. Firstly array indices are integers only. Secondly when
creating an array you need to specify numbers. What is WD_INDICE? It is not
a number.
what you can do is
int[] wndCount = new int [Enum.GetValues(typeof(WD_INDICE)).Length];
Since you want to initialize the array you don't have to specify number of
elements
int[] wndCount = new int [] {0, 0, 0, 0}; // the array will have 4 elements
wndCount[(int)WD_INDICE.YEAR] = 4;
Pay attention on the fact that you can't use enum values directly to index
the array. You have to cast them to int.
--
HTH
Stoitcho Goutsev (100) [C# MVP]