continue statement
Aus cppreference.com
[] |
This page has been machine-translated from the English version of the wiki using Google Translate.
The translation may contain errors and awkward wording. Hover over text to see the original version. You can help to fix errors and improve the translation. For instructions click here. |
<metanoindex/>
Veranlasst den verbleibenden Teil des umschlieenden for, range-for, while oder
do-while
Schleife bersprungen .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.
You can help to correct and verify the translation. Click [http://en.cppreference.com/w/Cppreference:MachineTranslations here] for instructions.
Original:
Causes the remaining portion of the enclosing for, range-for, while or
do-while
loop body skipped.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.
You can help to correct and verify the translation. Click [http://en.cppreference.com/w/Cppreference:MachineTranslations here] for instructions.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
Verwendet werden, wenn es sonst umstndlich zu den restlichen Teil der Schleife mit bedingten Anweisungen ignorieren .
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.
You can help to correct and verify the translation. Click here for instructions.
Syntax
continue
|
|||||||||
Erklrung
Diese Anweisung funktioniert als Verknpfung zum Ende des umschlieenden Schleife .
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.
You can help to correct and verify the translation. Click here for instructions.
Im Falle von while oder
do-while
Loops, die nchste Anweisung ausgefhrt wird, die Bedingung check (cond_expression). Im Falle von for Schleife, sind die nchsten Anweisungen ausgefhrt die Iteration Ausdruck und Zustand prfen (iteration_expression, cond_expression). Danach wird die Schleife weiter als normal .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.
You can help to correct and verify the translation. Click [http://en.cppreference.com/w/Cppreference:MachineTranslations here] for instructions.
Original:
In case of while or
do-while
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.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.
You can help to correct and verify the translation. Click [http://en.cppreference.com/w/Cppreference:MachineTranslations here] for instructions.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
Keywords
Beispiel
#include <iostream>
int main()
{
for (int i = 0; i < 10; i++) {
if (i != 5) continue;
std::cout << i << " "; //this statement is skipped each time i!=5
}
std::cout << '\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;
std::cout << j << k << " "; //this statement is skipped each time k==3
}
}
}
Output:
5
00 01 02 04 10 11 12 14