C++ Language/ProgramFlow/BreakStatement

From Wikibooks, open books for an open world
Jump to navigation Jump to search

A break statement aborts the execution of a loop. Instead of finishing the remaining statements in the loop's body, program flow immediately jumps to the code that follows the loop (ignoring the loop's condition).

  1. A Break in a Nested Loop
  2. Fallthrough in a Switch