mikroC - C Compiler for Microchip PIC microcontrollers
Do Statement
The
ment is:
do statement while ( expression );
The
remains non-zero. The
will execute
Parentheses around
Note that
colon (;). Other control structures end with statement which means that they
implicitly include a semicolon or a closing brace.
Here is an example of calculating scalar product of two vectors, using the
statement:
s = 0; i = 0;
do {
s += a[i] * b[i];
i++;
} while (i < n);
For Statement
The
for ([ init-exp ]; [ condition-exp ]; [ increment-exp ]) statement
Before the first iteration of the loop, expression
ables for the loop. You cannot pass declarations in
Expression
statement
After each iteration of the loop,
Consequently, i++ is functionally the same as ++i.
page
120
statement executes until the condition becomes false. Syntax of
do
is executed repeatedly as long as the value of
statement
expression
at least once.
statement
expression
is the only control structure in C which explicitly ends with semi-
do
statement implements an iterative loop. Syntax of
for
condition-exp
is executed repeatedly until the value of
MikroElektronika: Development tools - Books - Compilers
is evaluated after each iteration, so the loop
are mandatory.
init-exp
init-exp
is checked before the first entry into the block;
increments a loop counter.
increment-exp
making it simple...
state-
do
expression
do
statement is:
for
sets the starting vari-
.
is false.
condition-exp
mikroC
Need help?
Do you have a question about the PIC Microcontrollers PIC12 and is the answer not in the manual?