Oh right, the semicolon isn't necessary in #define statements. Probably why your code wasn't working right as well.
Re: error with switch statement
Posted: Mon May 10, 2010 5:00 pm
by K-Bal
Actually both versions are valid switch statements.
Re: error with switch statement
Posted: Mon May 10, 2010 5:05 pm
by GroundUpEngine
Dont you just love semi-colons!
Re: error with switch statement
Posted: Mon May 10, 2010 5:41 pm
by pritam
K-Bal wrote:Actually both versions are valid switch statements.
Oh really? I had no idea, never seen that before.
Re: error with switch statement
Posted: Mon May 10, 2010 5:46 pm
by Ginto8
pritam wrote:
K-Bal wrote:Actually both versions are valid switch statements.
Oh really? I had no idea, never seen that before.
{ and } just indicate a block, which is pretty much any piece of code with its own scope. So his code is syntactically valid, except for the case STATE_TITLE: line, because that gets preprocessed to be case 0;:
K-Bal wrote:Actually both versions are valid switch statements.
Oh really? I had no idea, never seen that before.
{ and } just indicate a block, which is pretty much any piece of code with its own scope. So his code is syntactically valid, except for the case STATE_TITLE: line, because that gets preprocessed to be case 0;: