I'm trying to compile some code
switch (myclass.getSomeInt()){
case 1:
....
break;
case 2:
...
break;
default:
....
}
I'm getting the following error:
"constant expression required at line x, column y"
Line X and column Y refers to the "switch(myclass.getSomeInt()" line.
Does that mean in switch(expr), expr must be a constant during compile
time? In this case what is the switch statement useful for?