Namespaces
Variants
Views
Actions

break statement

From cppreference.com
< c‎ | language
Revision as of 17:34, 31 May 2013 by P12bot (Talk | contribs)

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

Syntax

break

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.

Keywords

break

Example