4.2.3. do-while

Executes one or more statements until an expression is False.

Syntax:

do {
    statement;                   /* execute this statement */
    [statement;]...              /* additional statements */
} while (expression);            /* while this expression is True */

where:

expression

The expression to be evaluated at the end of each iteration of the loop.

Description

The do-while statement executes a given statement one or more times until an expression evaluates to False.

If you have more than one statement in the do-while loop these must be enclosed in curly braces ({}).

Return Value

None

Rules

None

Example

This example shows how to use do-while in a macro:

define /R void doloop()
{
  int i;
  i = 1;
  do {
    $printf "Iteration: %d\n", i$;
    i++;
  } while (i < 11);
}
.

See also

Copyright © 2002-2011 ARM. All rights reserved.ARM DUI 0175N
Non-ConfidentialID052111