Jumping from one case to the default case in switch statement

前端 未结 9 1051
予麋鹿
予麋鹿 2021-01-03 22:59
switch(ch){
          case \'a\':
                 //do something, condition does not match so go to default case
                 //don\'t break in here, and don\'t         


        
9条回答
  •  甜味超标
    2021-01-03 23:00

    goto For The Win

    switch (ch) {
        case 'a':
            if (1) goto LINE96532;
            break;
        case 'b':
            if (1) goto LINE96532;
            break;
    LINE96532:
        default:
            //
            break;
    }
    

提交回复
热议问题