Namespaces
Variants
Views
Actions

break statement

From cppreference.com

Causes the enclosing for, while or do-while loop or switch statement to terminate.

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

Contents

[edit] Syntax

break

[edit] Explanation

After this statement the control is transferred to the statement immediately following the enclosing loop. All automatic storage objects declared in enclosing loop are destroyed before the execution of the first line following the enclosing loop.

[edit] Keywords

break

[edit] Example