Namespaces
Variants
Views
Actions

break statement

From cppreference.com
< cpp‎ | language
Revision as of 14:47, 6 June 2011 by P12 (Talk | contribs)

Template:cpp/language/sidebar Causes the enclosing for, while or do-while loop or {{rlp|switch | switch statement} to terminate.

Used when it is otherwise awkward to terminate the loop using the condition expression and conditional statements.

Contents

Syntax

break

Explanation

After this statement the control is transferred to the statement following the enclosing loop.

Keywords

break

Example

Template:example cpp