
102
Compiler
© 2008 Conrad Electronic
that the Expression is again calculated and the entire procedure will constantly be repeated until the
Expression takes on the value
0
. An
can be defined instead of a single instruction.
Example:
while(a<
10
) a=a+
2
;
while(a)
{
a=a*
2
;
x=a;
}
break Instruction
If a break is executed within the loop then the loop will be left and the program execution starts with
the next instruction after the while loop.
continue Instruction
An execution of continue within a loop will immediately initialize a new calculation of the Expression
. Depending on the result the loop will be repeated at unequal
0
.
A result of
0
will terminate the loop.
Example:
while(
1
)
// endless loop
{
a++;
if(a>
10
) break;
// will terminate the loop
}
5.2.7
Functions
In order to structure a larger program it is separated into several sub-functions.
This not only improves the readability but allows to combine all program
instructions repeatedly appearing in functions. A program does in any case
contain the function "
main
", which is started in first place. After that other
functions can be called up.
A simple example:
void func1(void)
{
// instructions in function func1
.
.
}
Summary of Contents for C-Control Pro Mega Series
Page 1: ... 2008 Conrad Electronic C Control Pro Mega Series ...
Page 9: ...VIII Inhalt 2008 Conrad Electronic ...
Page 10: ...Part 1 ...
Page 17: ...Part 2 ...
Page 23: ...Part 3 ...
Page 41: ...32 Hardware 2008 Conrad Electronic 3 3 5 3 Component Parts Plan ...
Page 57: ...48 Hardware 2008 Conrad Electronic 3 4 5 3 Component Parts Plan ...
Page 58: ...Part 4 ...
Page 91: ...82 IDE 2008 Conrad Electronic ...
Page 92: ...Part 5 ...
Page 135: ...126 Compiler 2008 Conrad Electronic 31 1F US 63 3F 95 5F _ 127 7F DEL ...
Page 136: ...Part 6 ...
Page 231: ...Part 7 ...
Page 240: ......