Operator Precedence in C

From CodeCodex

Operators in the same grouping have the same precedence.

Priority Operators Remarks
Highest
array[index]
function(args)
struct.field
structptr->field
expr++
expr--
++expr
--expr
unary-op expr
sizeof expr
sizeof(type)
unary-op is one of “&”, “*”, “+”, “-”, “~” or “!”
(type) expr
expr * expr
expr / expr
expr % expr
expr + expr
expr - expr
expr << expr
expr >> expr
expr < expr
expr > expr
expr <= expr
expr >= expr
expr == expr
expr != expr
expr & expr
expr ^ expr
expr | expr
expr && expr
expr || expr
expr ? expr : expr
expr asst-op expr
asst-op is one of “=”, “*=”, “/=”, “%=” “+=”, “-=”, “<<=”, “>>=”, “&=”, “^=” or “|=”.
Lowest
expr, expr

Source: Kernighan & Ritchie, The C Programming Language 2nd ed, Prentice-Hall 1988, ISBN 0-13-110362-8, chapter A7.