프로그래밍/C
c precedence table
code cat
2013. 11. 23. 23:29
Level | Symbol | Description | Associativity |
---|---|---|---|
1 | ++ -- ( ) [ ] -> . |
Prefix increment Prefix decrement Function call and subexpression Array subscript Structure pointer Structure member |
left to right |
2 | ! ~ - + (type) * & sizeof |
Logical negation 1's complement Unary negation Unary plus Type cast Pointer dereference Address of Size of |
right to left |
3 | * / % |
Multiplication Division Modulus (integer remainder) |
left to right |
4 | + - |
Addition Subtraction |
left to right |
5 | << >> |
Bitwise left shift Bitwise right shift |
left to right |
6 | < <= > >= |
Less than Less than or equal to Greater than Greater than or equal to |
left to right |
7 | == != |
Equal test Not equal test |
left to right |
8 | & | Bitwise AND | left to right |
9 | ^ | Bitwise exclusive OR (XOR) | left to right |
10 | | | Bitwise inclusive OR | left to right |
11 | && | Logical AND | left to right |
12 | || | Logical inclusive OR | left to right |
13 | ?: | Conditional test | right to left |
14 | = += -= *= /= %= <<= >>= &= ^= | |
Assignment Compound add Compound subtract Compound multiply Compound divide Compound modulus Compound bitwise left shift Compound bitwise right shift Compound bise AND Compound bitwise exclusive OR Compound bitwise inclusive OR | right to left |
15 | , ++ -- |
Sequence point (list separator) Postfix increment Postfix decrement |
left to right |