KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
switch(ch){ case 'a': //do something, condition does not match so go to default case //don't break in here, and don't allow fall through to other cases. case 'b': //.. case 'c': //.. case '_': //... default: // break; } In a switch statement like above one I enter case 'a', I break only if the condition inside it occurs, otherwise I want to jump to default case. Is there any other way of doing this rather than labels or gotos?
Tags (comma-separated)
Save Edits
Cancel