c++ break语句

您所在的位置:网站首页 c语言break语句用法 c++ break语句

c++ break语句

#c++ break语句| 来源: 网络整理| 查看: 265

c++ break语句

In this article, we’ll take a look at how we can use the break statement in C/C++.

在本文中,我们将研究如何在C / C ++中使用break语句。

Similar to the continue statement, we can use the break statement to manipulate loop control.

类似于continue语句 ,我们可以使用break语句来操纵循环控制。

Let’s take a look at this, using some examples!

让我们用一些例子来看看!

在C / C ++中使用break语句 (Using the break statement in C/C++)

While we can use the continue statement to jump to the next iteration of the loop, the break statement breaks out of the loop.

虽然我们可以使用continue语句跳转到循环的下一个迭代,但break语句会跳出循环。

This jumps to the next instruction proceeding the loop body while maintaining the state of all non-local variables of the loop.

这跳转到下一条指令,继续循环主体,同时保持循环的所有非局部变量的状态。

To see how this works out, let’s look at an example, using while loops.

要查看其效果,让我们来看一个使用while循环的示例。



【本文地址】


今日新闻


推荐新闻


CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3