C operator precedence

Table 4.11 lists all the C operators in order of decreasing
precedence. Operators on the same line have the same precedence.

 Table 4.11. C operator precedence.

Level Operators
1 () [] -> .
2 ! ~ ++ -- * (indirection) & (address-of) (type)
sizeof + (unary) - (unary)
3 * (multiplication) / %
4 + -
5 << >>
6 < <= > >=
7 == !=
8 & (bitwise AND)
9 ^
10 |
11 &&
12 ||
13 ?:
14 = += -= *= /= %= &= ^= |= <<= >>=
15 ,
() is the function operator; [] is the array operator.

 

Dette indlæg blev udgivet i Knowledge Base, Old Base, Programmering. Bogmærk permalinket.

Skriv et svar