Using continue in a switch statement

后端 未结 7 530
盖世英雄少女心
盖世英雄少女心 2020-12-13 03:29

I want to jump from the middle of a switch statement, to the loop statement in the following code:

while (something = get_something())
{
    swi         


        
7条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-13 03:40

    Yes, it's OK - it's just like using it in an if statement. Of course, you can't use a break to break out of a loop from inside a switch.

提交回复
热议问题