C Language / Operators Precedence

Operators Precedence tells us how the associativity of an operator is a property that determines how operators of the same precedence are grouped in the absence of parentheses. Operators may be associative / grouped arbitrarily, left- associative (operations are grouped from the left), right-associative (operations are grouped from the right).

Operator Operator Symbol Associativity
Postfix () [] -> . ++ - - Left to right
Unary + - ! ~ ++ - - (type)* & sizeof Right to left
Multiplicative * / % Left to right
Additive + - Left to right
Shift << >> Left to right
Relational < <= > >= Left to right
Equality == != Left to right
Bitwise AND & Left to right
Bitwise XOR ^ Left to right
Bitwise OR | Left to right
Logical AND && Left to right
Logical OR || Left to right
Conditional ?: Right to left
Assignment = += -= *= /= %=>>= <<= &= ^= |= Right to left
Comma , Left to right


Home     Back