94
Compiler
© 2008 Conrad Electronic
conceal the global variable. While the program is working in the function where the identically named
variable has been defined the global variable cannot be addressed.
Static Variables
With local variables the property static can be placed for the data type.
void func1(void)
{
static int a;
}
In opposition to normal local variables will static variables still keep their value even if the function is
left. At a further call-up of the function the static variable will have the same contents as when leaving
the function. In order to have the contents of a static variable defined at first access the static
variables will equally to global variables at program start also be initialized by zero.
5.2.5
Operators
Priorities of Operators
Operators separate arithmetic expressions into partial expressions. The operators are then evaluated
in the succession of their priorities (precedence). Expressions with operators of identical precedence
will be calculated from left to right.
Example:
i=
2
+
3
*
4
-
5
;
// result 9 => first 3*4, then +2, finally -5
The succession of the execution can be influenced by setting of parenthesis. Parenthesis have the
highest priority.
If the last example should strictly be calculated from left to right, then:
i= (
2
+
3
)*
4
-
5
;
// result 15 => first 2+3, then *4, finally -5
A list of priorities can be found in
5.2.5.1
Arithmetic Operators
All arithmetic operators with the exception of Modulo are defined for Integer and Floating Point data
types. Modulo is restricted to data type Integer only.
It must be observed that in an expression the figure
7
will have an Integer data type assigned to
it. If a figure of data type float should be explicitly created then a decimal point has to be added:
7.0
Operator
Description
Example
Result
+
Addition
2+1
3.2 + 4
3
7.2
-
Subtraction
2 - 3
22 - 1.1e1
-1
11
Содержание C-Control Pro Mega Series
Страница 1: ... 2008 Conrad Electronic C Control Pro Mega Series ...
Страница 9: ...VIII Inhalt 2008 Conrad Electronic ...
Страница 10: ...Part 1 ...
Страница 17: ...Part 2 ...
Страница 23: ...Part 3 ...
Страница 41: ...32 Hardware 2008 Conrad Electronic 3 3 5 3 Component Parts Plan ...
Страница 57: ...48 Hardware 2008 Conrad Electronic 3 4 5 3 Component Parts Plan ...
Страница 58: ...Part 4 ...
Страница 91: ...82 IDE 2008 Conrad Electronic ...
Страница 92: ...Part 5 ...
Страница 135: ...126 Compiler 2008 Conrad Electronic 31 1F US 63 3F 95 5F _ 127 7F DEL ...
Страница 136: ...Part 6 ...
Страница 231: ...Part 7 ...
Страница 240: ......