Priority Level
operator
Description
Example
Binding Nature
1
()[]-.::++--
The parentheses operator that adjusts the precedenceArray Subscript access operatorTo access a member's operator by pointing to the
Arithmetic operators
Operator name Result
$a + $b addition $a and $b and
$a-the difference between $b subtraction $a and $b
$a * $b multiplication $a and the product of $b
$a/$b division $a divided by the quotient of the $b
$a% $b modulo $a divided
One, C # operator PrecedenceThe C # operator is also known as C # operators.When an expression contains more than one operator, the order of operations for the operator occurs. In C #, the precedence of operators is used to solve the order of
Original location http://caibaojian.com/toutiao/54461. All variable declarations (VAR) or declared functions will be promoted to the top of the current functionWith regard to function expressions, JS splits the code into two lines of code to execute
Arithmetic operators
Operator name Result
$a + $b addition $a and $b and
$a-the difference between $b subtraction $a and $b
$a * $b multiplication $a and the product of $b
$a/$b division $a divided by the quotient of the $b
$a% $b modulo $a divided
Priority Level
operator
Description
Example
Binding Nature
1
()[]-.::++--
The parentheses operator that adjusts the precedenceArray Subscript access operatorTo access a member's operator by pointing to the
Priority level
operator
description
examples
of associativity
1
()[]-.::++--
The parentheses operator that adjusts the precedenceArray Subscript access operatorTo access a member's operator by
Lambda Lambda expressionor boolean "or"and Boolean "and"Not x boolean "non"In,not in member TestIs,is not identity test,>=,!=,== comparison| Bitwise OR^ Bitwise XOR OR& Bitwise AND> shift+,-Addition and subtraction*,/,% Multiplication, division and
The following table lists all the operators from highest to lowest priority:
operator
Description
**
Index (highest priority)
~ + -
Bitwise flip, unary Plus and minus (the last two methods
The sequential calculation of the operator can be saved with a stack, in several cases1, the current 1+2-3 is the same priority, then the first one can be counted.2,1+2*3 I do not deal with this situation (note: I only choose whether to deal with
The following table lists the precedence and associativity of C + + operators. Operators is listed top to bottom, in descending precedence.
Precedence
Operator
Description
associativity
1
::
Scope
The problem of operator precedence in C is generally not required, but if you can remember, it is very helpful to quickly understand code and programming; If you can quickly remember, why not?If you like, it is recommended to first download my
Arithmetic operators
Operator name Result
$a + $b addition $a and $b and
$a-$b subtraction $a and $b difference
$a * $b multiplication of $a and $b
$a/$b division $a divided by $b quotient
$a% $b modulo $a divided by the remainder of the
Priority level
Operator
Name or meaning
Use form
Combination direction
Description
1
[]
Array subscript
array name [constant expression]
Left to right
()
Parentheses
When you hit the code, it happened that the priority of the left-shift operator was lower than the addition operator and left-shifted. Then I found this watch ...
Priority level
Operator
Name or meaning
Use form
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.