precedence (7) - Linux Manuals

precedence: C operator precedence and order of evaluation

NAME

operator - C operator precedence and order of evaluation

DESCRIPTION

This manual page lists C operators and their precedence in evaluation.

OperatorAssociativityNotes
() [] -> . ++ --left to right[1]
! ~ ++ -- + - (type) * & sizeofright to left[2]
* / %left to right
+ -left to right
<< >>left to right
< <= > >=left to right
== !=left to right
&left to right
haleft to right
|left to right
&&left to right
||left to right
?:right to left
= += -= *= /= %= <<= >>= &= ha= |=right to left
,left to right

The following notes provide further information to the above table:

[1]
The ++ and -- operators at this precedence level are the postfix flavors of the operators.
[2]
The ++ and -- operators at this precedence level are the prefix flavors of the operators.

COLOPHON

This page is part of release 5.10 of the Linux man-pages project. A description of the project, information about reporting bugs, and the latest version of this page, can be found at https://www.kernel.org/doc/man-pages/.