| Umesh_karthy_41cdd8 wrote: |
hi
for(int cnt=0;...) { switch(cnt) case 1: ... .... case 2: .... ... }
i have a similar code. but i'm getting an compilation error as follows: "control cannot flow thro from one case lable to another."
can u help me with this? what does it mean? what should i do to rectify it??
|
|
One or more of your "case" statements does not have a break command:
switch (variableName) {
case value1:
// .. some code goes here.
case value2:
// .. some more code here.
}
Whereas this would work:
switch (variableName) {
case value1:
// .. some code goes here.
break;
case value2:
// .. some more code here.
break;
}