switch(ch){
case \'a\':
//do something, condition does not match so go to default case
//don\'t break in here, and don\'t
I'm not sure if thes is the best answer, but here it goes:
If you absolutely do not want to use labels, and you want to keep the cases in their current order, then you could continue after case 'a' and then check so see if(ch != 'a') at the beginning of each subsequent case, only executing the statement if the condition is true:
switch(ch){
case 'a':
// do something
case 'b':
if(ch != 'a') {
//do something
}
//repeat for each subsequent case
default:
//do something
break;
}
This is probably not the most efficient way to solve your problem, but it should accomplish what you want.