switch
次のコードのステートメントの途中からループステートメントにジャンプしたい:
while (something = get_something())
{
switch (something)
{
case A:
case B:
break;
default:
// get another something and try again
continue;
}
// do something for a handled something
do_something();
}
これは有効な使用方法continue
ですか? continue
ステートメントはステートメントによって無視されswitch
ますか? ここで C と C++ の動作は異なりますか?