continue statement

来自cppreference.com

 
 
C语言编写
大会的主题
Original:
General topics
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
预处理器
评论
关键字
ASCII表
转义序列
C
流量控制
Original:
Flow control
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
条件执行语句
Original:
Conditional execution statements
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
迭代语句
Original:
Iteration statements
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
跳转语句
Original:
Jump statements
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
continue statement
break statement
功能
Original:
Functions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
函数声明
的历史。内嵌说明
类型
Original:
Types
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
规范
Original:
Specifiers
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
CV符
存储类说明
alignas说明 (C99)
Original:
Literals
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
表达式
Original:
Expressions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
为了评价
其他运营商
运营商
运算符的优先级
实用工具
Original:
Utilities
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
typedef declaration
属性 (C99)
转换
杂项
Original:
Miscellaneous
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
内联汇编
 
循环体的其余部分.
Original:
否则尴尬忽略循环使用条件语句的剩余部分时,它是使用.
Original:
Used when it is otherwise awkward to ignore the remaining portion of the loop using conditional statements.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

目录

[编辑] 语法

continue

[编辑] 解释

这条语句作为一个快捷方式到最后的封闭循环体.
Original:
This statement works as a shortcut to the end of the enclosing loop body.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
循环,执行的下一条语句条件检查(cond_expression)的。 for循环的情况下,下一个执行的语句是迭代表达式条件检查(iteration_expressioncond_expression)的的。之后,循环将继续正常.
Original:
In case of while or
DO-WHILE
Original:
do-while
The text has been machine-translated via [http://translate.google.com Google Translate].
You can help to correct and verify the translation. Click [http://en.cppreference.com/w/Cppreference:MachineTranslations here] for instructions.
</div>
loops, the next statement executed is the condition check (cond_expression). In case of for loop, the next statements executed are the iteration expression and condition check (iteration_expression, cond_expression). After that the loop continues as normal.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[编辑] 关键字

continue

[编辑] 为例

#include <stdio.h>
 
int main() 
{
    for (int i = 0; i < 10; i++) {
        if (i != 5) continue;
        printf("%d ", i);       //this statement is skipped each time i!=5
    }
 
    printf("\n");
 
    for (int j = 0; j < 2; j++) {
        for (int k = 0; k < 5; k++) { //only this loop is affected by continue
            if (k == 3) continue;
            printf("%d%d ", j, k);    //this statement is skipped each time k==3
        }
    }
}

Output:

5
00 01 02 04 10 11 12 14