switch/case problem: 'case must be a string or an integral constant'

SirErugor ontherenth at gmail.com
Fri Mar 9 03:08:16 PST 2007


Hi there :)

I'm just doing a basic switch/case like this:
static final int PONG = 1;
...
input.msgcode = PONG;
...
switch(input.msgcode)
{
     case PONG:
            ....
            break;
}

If I do something like this I get the following error:
"server.d:189: Error: case must be a string or an integral constant, not PONG"

What do I do?

Cheers!


More information about the Digitalmars-d-learn mailing list