#: Equal priority operators, the order of operations is determined by the binding direction; different precedence operators, the order of operations from high to low priority.
The union direction is mostly left-to-right, but the "single-item" condition "assignment" operator is executed from right to left.
Elementary operator () [].
|
single-Mesh operator! ~ + +---"minus" (type) * "pointer" & sizeof
|
arithmetic operators * "multiplication"/% +->> <<
|
relational operators < <= > >= = = =! = & |
|
Logical Operators | | &&
|
conditional operator?:
|
assignment operator = + = = *=/=%= >>= <<= &=
|
comma operator,
Cases:
<1>*p++,* and + + a rank, right-to-left, executes address +1 first, and removes the corresponding value at execution.
<2>* (p++) and * (++P), the former is the first operation of p after the address plus 1, the latter is the address first plus 1 after the operation.
<3> (*p) + +, first find the current p corresponding variable value, and then the variable from 1, such as P=a, (*p) + + = a[0]+1.
<4>while ((*to++ = *from++)! = ' + ') assigns *from to *to first, then to and from plus 1, and finally determines if *to is ' not ', not continuing assignment
Diary of C-operator precedence and binding direction