I encountered a strange problem about switch-case statement.
switch(cmd)
{
case 1: statements; break;
case 2: statements; break;
... ....
case 11: S1;
S2;
S3;
statements;
break;
... ...
case xx
}
When the cmd is above 11, the first two statements are skipped. Take case 11
as example
the first executing statement is S3, not S1.
What the problem is?
switch(cmd)
{
case 1: statements; break;
case 2: statements; break;
... ....
case 11: S1;
S2;
S3;
statements;
break;
... ...
case xx
}
When the cmd is above 11, the first two statements are skipped. Take case 11
as example
the first executing statement is S3, not S1.
What the problem is?
Comment