Operator Precedence List
The standard C operators are listed below in order of highest precedence
to lowest precedence. The associativity of the operator is also
indicated.
- left to right:
(),
[],
.,
->,
++ (postfix) and
-- (postfix).
- right to left:
++ (prefix),
-- (prefix),
!,
~,
sizeof,
(type) (type casting),
+ (unary),
- (unary),
& (address) and
* (dereference).
- left to right:
*,
/ and
%.
- left to right:
+ and
-.
- left to right:
<< and
>>.
- left to right:
<,
<=,
> and
>=.
- left to right:
== and
!=.
- left to right: &.
- left to right: ^.
- left to right: |.
- left to right: &&.
- left to right: ||.
- right to left: ?:.
- right to left:
=,
+=,
-=,
*=,
/=,
%=,
>>=,
<<=,
&=,
^= and
|=.
- left to right: , (comma operator).
Last Modified:
Tue Sep 20 14:51:02 EDT 1994
Richard Chang, chang@gl.umbc.edu