C language has many operators, in addition to arithmetic, there are bit operations, comparison operations, logic operations, assignment operations, and so on, dazzling at the same time, the priority also makes people headache. It is usually recommended that you do not omit parentheses when writing code, but not all programmers follow this rule, so it is necessary to record it for review.
Summarize some of the more important principles:
- Takes the member's "0" mesh operator (). -> [] "has the highest priority;
- The monocular operator is higher than the binocular operator;
- Arithmetic is higher than shift operation;
- The shift operation is higher than the comparison operation;
- The comparison operation is higher than the bitwise operation, and the bit operation is higher than the logical operation;
- The logical operation is higher than the assignment operation;
- Commas are always the lowest.