Is there any possible way to do arithmetic 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: case One: ..... } Var++; } }
(I know this increment is not possible, but is there anyway that we can have this variable called Var increment?)
maddy source share