Precedence and Associativity of Operators

Operators 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
= += -= *= /= %= &= ^= |= <<= >>= right to left
, left to right

Examples

i < limit – 1

i < lim-1 && (c=getchar()) != ‘\n’ && c != EOF

Leave a Reply

Your email address will not be published. Required fields are marked *