> > If you have an enum, is there any way during execution to find the
number
> of
> > values in the enum?
>
> No.
yeah, i didnt think there was.
> From that you can do int(fifteen)+1, but this is a very special case.
> As soon as 'great' is changed to
>
> enum great { five = 5, ten = 10, fifteen = 15 };
that is a very good way to get around the problem!
> 'great' has to be around. Just open the definition and count.
At the moment, the definition is changing as i go along programming, adding
in new cases as i go along.
i cant be bothered thinking up all the possible cases that i might need,
because i just know later down the track i'll think of a new one. So that
method of adding an extra one at the end seems like the solution i am
looking for.
Thankyou for the information.
|