Is there any possible way to do any arithmetic operations on enum values?
enum Type{Zero=0,One,Two,Three,Four,Five,Six,Seven,Eight,Nine};
main()
{
enum Type Var = Zero;
for(int i=0;i<10;i++)
{
switch(Var)
{
case Zero:
/*do something*/
case One:
/*Do something*/
.....
}
Var++;
}
}
(I know that this increment is not possible, but is there anyway by which we can have this variable named Var increment?)