Like many programming languages, C applies its operators to expressions according to their precedence. Operators with high precedence are applied first. This parallels the precedence of operators in arithmetic, where multiplications take place before additions. The table below lists the numerous C operators grouped by their precedence (higher precedence first).
| Operator Type | Operators |
|---|---|
| Expression | () [] . ->
|
| Unary | - ~ ! * & ++ -- sizeof()
|
| Multiplicative | * / %
|
| Additive | + -
|
| Shift | << >>
|
| Relational (inequality) | < <= > >=
|
| Relational (equality) | == !=
|
| Bitwise AND | &
|
| Bitwise XOR | ^
|
| Bitwise OR | |
|
| Logical AND | &&
|
| Logical OR | ||
|
| Conditional | ?:
|
| Assignment | = *= /= %= -= <<= >>= &= |= ^=
|
| Sequential Evaluation | ,
|




Add new comment