switch case: error: case label does not reduce to an integer constant
switch labels must be constant expressions, they have to be evaluated at compile time. If you want to branch on run-time values, you must use an if. A const-qualified variable is not a constant expression, it is merely a value you are not allowed to modify. The form of integer constant expressions is detailed in … Read more