Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Microsoft C - <b>do do-while statement</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
do                       do-while Statement

 do
     statement
 while (expression);

    The do-while statement executes the statements in the body, and then
    evaluates the looping criteria at the end of the loop.  If the
    expression is true, the loop is re-entered and the body is executed
    again. When the expression tests false control is passed to the next
    statement following the loop.

      Notes:    With the do-while construct, the statements in the body
                are always executed at least once.  That's because the
                condition is tested at the end of the loop, rather than
                at the beginning--as in the `for' and `while' statements.

                You can terminate a do statement prematurely by using a
                continue or break statement.

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

           do {              /* Use braces for multiple statements */
               process();
               i++;
           } while (i < 20);

See Also: while continue break

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