Priority and combination of the C Operator
Priority |
Operator |
Description |
Number of involved objects |
Integration direction |
1 |
() [] -> . |
Parentheses Subscript operator Point to struct member operators Struct member operators |
Binary Operators Binary Operators Binary Operators
|
From left to right |
2 |
! ~ ++ -- - (Type) * & Sizeof |
Logical non-Operator Bitwise Inverse Operator Auto-increment operator Auto-subtraction Operator Negative Operator Type conversion Operator Pointer Operator Bitwise operators Evaluate the type length Operator |
Single Object Operator |
From right to left |
3 |
* / % |
multiplication operator division operator remainder operator |
binary operators / TD> |
from left to right |
4 |
+ - |
addition operator subtraction operator |
binary operators / TD> |
from left to right |
5 |
|
shift left operator shift right operator |
binary operators / TD> |
from left to right |
6 |
<= >= |
Relational operators / TD> |
binary operators / TD> |
from left to right |
7 |
=< SPAN lang =" En-us "> ! = |
equality operators unequal operators |
binary operators / TD> |
from left to right |
8 |
& |
bitwise AND operator |
binary operators / TD> |
from left to right |
9 |
^ |
bitwise XOR or operator |
binary operators / TD> |
from left to right |
10 |
| |
bitwise OR operator |
binary operators / TD> |
from left to right |
11 |
& / TD> |
logic and operators |
binary operators / TD> |
from left to right |
12 |
|| / TD> |
logical or operator |
binary operators / TD> |
from left to right |
13 |
?: |
conditional operators / TD> |
three-object operator / TD> |
from right to left |
14 |
= + = -= * = /= %= >>= <= & = ^= |= |
Value assignment operator |
Binary Operators |
from right to left |
15 |
, |
Comma Operator (Sequence evaluate operator) |
|
From left to right |
Ref:
Http://blog.csdn.net/awpatp/archive/2007/11/28/1905374.aspx
Http://www2.tust.edu.cn/jingpin/jp2006/claguage/starark/ArticleShow.asp? ArticleID = 174
Http://www.edujy.com/c/basic/p3-2.htm
Http://www.et-dz.com/plus/view.php? Aid = 3800.