| |||
| Home > RealView Debugger Keywords > Alphabetical keyword reference > do-while | |||
Executes one or more statements until an expression is False.
do {statement; /* execute this statement */ [statement;]... /* additional statements */ } while (expression); /* while this expression is True */
where:
expressionThe expression to be evaluated at the end of each iteration of the loop.
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 ({}).
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);
}
.