
Conditional operators
The conditional operator ?: is a shortcut for executing a statement between
two selectable statements according to the result of the expression.
<expr> ? <statement1> : <statement2>
If <expr> evaluates to a nonzero value, <statement1> is executed. Other-
wise, <satement2> is executed.
Comma operator
A pair of expressions separated by a comma is evaluated from left-to-right
and the value of the left expression is discarded. All side effects of the left
expression are performed before the evaluation of the right expression. The
type and value of the result are the type and value of the right operand. For
example,
f(a, (t=3, t+2), c) ;
has three arguments, the second of which has the value 5.
Precedence and associativity of operators
The following table lists the precedence and associativity of operators. The
precedence is from the highest to the lowest. Each box holds operators with
the same precedence. Unary and assignment operators are right associa-
tive, all others are left associative.
Operators
Description
Associativity
[ ]
( )
–>
.
sizeof
subscription
parenthesis
structure pointer
structure member
size of type increment
left to right
++
– –
~
!
–
+
&
*
increment
dcrement
complement
not
unary minus
unary plus
address of
dereference
right to left
*
/
%
multiply
divide
modulus (remainder)
left to right
Chapter 9 Holtek C Language
93
Содержание HT-IDE
Страница 11: ...P a r t I Integrated Development Environment Part I Integrated Development Environment 1 ...
Страница 12: ...HT IDE User s Guide 2 ...
Страница 20: ...Fig 1 6 Fig 1 7 HT IDE User s Guide 10 ...
Страница 24: ...HT IDE User s Guide 14 ...
Страница 70: ...HT IDE User s Guide 60 ...
Страница 76: ...HT IDE User s Guide 66 ...
Страница 92: ...HT IDE User s Guide 82 ...
Страница 93: ...P a r t I I Development Language and Tools Part II Development Language and Tools 83 ...
Страница 94: ...HT IDE User s Guide 84 ...
Страница 148: ...HT IDE User s Guide 138 ...
Страница 150: ...Fig 12 1 Fig 12 2 HT IDE User s Guide 140 ...
Страница 154: ...HT IDE User s Guide 144 ...
Страница 192: ...HT IDE User s Guide 182 ...
Страница 194: ...HT IDE User s Guide 184 ...
Страница 218: ...HT IDE User s Guide 208 ...
Страница 235: ...P a r t V Appendix Part V Appendix 225 ...
Страница 236: ...HT IDE User s Guide 226 ...
Страница 250: ...HT IDE User s Guide 240 ...