Namespaces
Variants
Views
Actions

Difference between revisions of "cpp/language/break"

From cppreference.com
< cpp‎ | language
(Close braces)
Line 45: Line 45:
 
         }
 
         }
 
     }
 
     }
 +
}
 
  | output=
 
  | output=
 
2345
 
2345
 
00 01 10 11
 
00 01 10 11
 
}}
 
}}

Revision as of 03:41, 10 October 2011

Template:cpp/language/sidebar 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 following the enclosing loop.

Keywords

break

Example

Template:example cpp