Difference between revisions of "cpp/language/continue"
From cppreference.com
m (Text replace - "{{keywords}}" to "===Keywords===") |
m (Text replace - "<!-- ======== --> " to "") |
||
Line 5: | Line 5: | ||
Used when it is otherwise awkward to ignore the remaining portion of the loop using conditional statements. | Used when it is otherwise awkward to ignore the remaining portion of the loop using conditional statements. | ||
− | |||
===Syntax=== | ===Syntax=== | ||
Line 12: | Line 11: | ||
{{sdcl list end}} | {{sdcl list end}} | ||
− | |||
===Explanation=== | ===Explanation=== | ||
Line 19: | Line 17: | ||
In case of {{rlp|while}} or {{rlp|do | do-while}} loops, the next statement executed is the condition check ({{sparam|cond_expression}}). In case of {{rlp|for}} loop, the next statements executed are the iteration expression and condition check ({{sparam|iteration_expression}}, {{sparam|cond_expression}}). After that the loop continues as normal. | In case of {{rlp|while}} or {{rlp|do | do-while}} loops, the next statement executed is the condition check ({{sparam|cond_expression}}). In case of {{rlp|for}} loop, the next statements executed are the iteration expression and condition check ({{sparam|iteration_expression}}, {{sparam|cond_expression}}). After that the loop continues as normal. | ||
− | |||
===Keywords=== | ===Keywords=== | ||
{{ltt|cpp/keywords/continue}} | {{ltt|cpp/keywords/continue}} | ||
− | |||
===Example=== | ===Example=== | ||
{{example cpp | {{example cpp |
Revision as of 18:14, 2 August 2011
Template:cpp/language/sidebar Causes the remaining portion of the nearest for, while or do-while loop body skipped.
Used when it is otherwise awkward to ignore the remaining portion of the loop using conditional statements.
Contents |
Syntax
continue
|
|||||||||
Explanation
This statement works as a shortcut to the end of the nearest loop body.
In case of while or do-while loops, the next statement executed is the condition check (Template:sparam). In case of for loop, the next statements executed are the iteration expression and condition check (Template:sparam, Template:sparam). After that the loop continues as normal.