Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Borland C++ 2.x ( with Turbo C ) - <b>break break statement</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 break                   break Statement

 break;

    The break statement terminates the execution of the innermost
    enclosing do, for, while or switch statement.  Control is then
    transferred to the statement following the terminated loop.

      Notes:    If the break keyword appears in any other context, a
                syntax error is generated.

                `Break' terminates only the innermost loop. To leave an
                outer loop from within an inner (nested) loop, you can
                use the return or (shudder) goto statements.

                There is distinct difference between the effects of
                `break' and `continue':  `break' actually exits the loop,
                whereas continue skips the remainder of the body, and
                then continues the loop with the next iteration.

   -------------------------------- Example ---------------------------------

           while (1) {
               if (condition)
                   break;
               ...
           }
           next-statement;



See Also: do for while switch goto return continue

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson