Type, precedence, and binding of operators
The number of operators and expressions in the C language is rare in advanced languages. It is the rich operators and expressions that make the C language function perfect. This is also one of the main features of C language.
The C language operator not only has different priority, but also has one characteristic, is its binding nature. In an expression, the order in which the operands participate is not only governed by the precedence of the operator, but also by the binding of the operators, so as to determine whether to operate from left to right or from right to left. This binding is not the same as the operators of other advanced languages, thus increasing the complexity of the C language.
Types of Operators C-language operators can be grouped into the following categories:
1. Arithmetic operators
For all kinds of numerical operations. Including plus (+), minus (-), multiply (*), in addition to (/), residual (or modulo operation,%), self-increase (+ +), since minus (-) a total of seven kinds.
2. Relational operators
For comparison operations. Includes six species greater than (>), less than (<), equal to (= =), greater than or equal (>=), less than or equal (<=), and not equal to (!=).
3. Logical operators
Used for logical operations. including with (&&), or (| |), NON (!) Three species.
4. Bitwise operator operator
The amount of the participating operation, which is calculated by bits. Includes bits and (&), bits or (|), bits (~), bitwise XOR, or (^), left (<<), right Shift (>>) six kinds.
5. Assignment operator
For assignment operations, it is divided into simple assignment (=), compound arithmetic Assignment (+=,-=,*=,/=,%=) and compound bit operation Assignment (&=,|=,^=,>>=,<<=) three class altogether 11 kinds.
6. Conditional operators
This is a three-mesh operator for conditional evaluation (?:).
7. Comma operator
Used to combine a number of expressions into an expression (,).
8. Pointer operators
For content (*) and address (&) two operations.
9. Find the number of bytes operator
The number of bytes (sizeof) used to compute the data type.
10. Special Operators
with parentheses (), subscript [], member (→,.) and several.