c語言switch case用法 switch語句中case后只能加什么?
switch語句中case后只能加什么?Switch(expression){case constant expression 1:語句1;case constant expression 2:語句2
switch語句中case后只能加什么?
Switch(expression){case constant expression 1:語句1;case constant expression 2:語句2;--case constant expression n:語句n;default:語句n 1}含義:計算表達式的值。當表達式的值等于常量表達式的值時,執(zhí)行以下語句,然后停止判斷,并執(zhí)行以下所有語句。如果表達式的值在所有情況下都不同于常量表達式的值,則執(zhí)行default之后的語句。