admin Site Admin
Joined: 28 Feb 2006 Posts: 24
|
Posted: Tue Jul 18, 2006 6:40 pm Post subject: C Operator Precedence |
|
|
In case you haven't memorized all of these yet, here is a table of operator precedence in C. Also listed is the associativity, which basically dictates the order in which operands are evaluated for binary expressions.
If you are on a FreeBSD or Linux system, you can simply type "man operator" to pull up a man page with this information.
| Code: |
OPERATOR(7) BSD Miscellaneous Information Manual OPERATOR(7)
NAME
C operator - C operator precedence and order of evaluation
DESCRIP= += -= *= /= %= <<= >>= &= ^= |= right to left
,TION
This manual page lists C operators and their precedence in evaluation.
Operator Associativity
-------- -------------
() [] -> . left to right
! ~ ++ -- - (type) * & sizeof right to left
* / % left to right
+ - left to right
<< >> left to right
< <= > >= left to right
== != left to right
& left to right
^ left to right
| left to right
&& left to right
|| left to right
?: right to left
left to right
BSD August 24, 2003 BSD
|
|
|