C operator precedence
Group | Operators | Associativity |
---|---|---|
parens; dereferencing | (expr) [i] -> . | Left ⇒ Right |
Everything unary |
++
--
(type)
! - * & |
Right ⇐ Left |
Multiplication | * / % | Left ⇒ Right |
Addition | + - | Left ⇒ Right |
Inequality | < <= > >= | Left ⇒ Right |
Equality | == != | Left ⇒ Right |
And | && | Left ⇒ Right |
Or | || | Left ⇒ Right |
If | q ? expr_t : expr_f | Right ⇐ Left |
Assignment | +=
-=
*= /= %= = |
Right ⇐ Left |
Expression division | , | Left ⇒ Right |