Namespaces
Variants
Views
Actions

Difference between revisions of "cpp/language/break"

From cppreference.com
< cpp‎ | language
m (Text replace - "<< std::endl" to "<< '\n'")
m (Text replace - " return 0; }" to "}")
Line 44: Line 44:
 
             std::cout << j << k << " ";
 
             std::cout << j << k << " ";
 
         }
 
         }
     }
+
     }}
    return 0;
+
}
+
 
  | output=
 
  | output=
 
2345
 
2345
 
00 01 10 11
 
00 01 10 11
 
}}
 
}}

Revision as of 04:21, 24 August 2011

Template:cpp/language/sidebar Causes the enclosing for, while or do-while loop or [[cpp/language/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

]]