I stumbled upon the gcc error "case label does not reduce to an integer constant" when trying to use a const int variable in a case statement.
Basically what is discussed in this thread: http://bytes.com/topic/c/answers/617...ant-expression
Nevertheless all the provided solutions don't work for me (except using #define apparently).
If I just have a simple program like:
it (3.3.5 as well as 4.3.3) still gives me that error.
What am I doing wrong?
Basically what is discussed in this thread: http://bytes.com/topic/c/answers/617...ant-expression
Nevertheless all the provided solutions don't work for me (except using #define apparently).
If I just have a simple program like:
Code:
int main( int argc, char** argv ) {
int switcher = 0;
const int testconst = 1337;
switch( switcher ) {
case testconst:
break;
}
}
What am I doing wrong?
Comment