Whenever you want to find which operator priority high, many times always want to find no, really make people angry! Now, finally, I personally feel very full, to share with you, welcome to make bricks!
C-language operator precedence
Back to the C language, feel that the combination of C language operators it is necessary to mention, after all, last year I just learned the C language, I did not understand the problem of integration.
What is left binding. What is the right
Operator PrecedenceThe following list shows the order in which operator precedence is from low to high. Operators that are arranged on the same line have the same precedence.
:=
| |, or, XOR
&&, and
Not
BETWEEN, case, when, THEN, ELSE
=, , >=,
The MySQL official documentation provides operators with the following precedence:Operator Precedences is shown in the following list, from highest precedence to the lowest. Operators that is shown together on a line has the the same precedence.1
The operators in C that have right-associative features include all monocular operators as well as assignment operators (=) and conditional operators. Others are left-associative.When judging the order of the expression evaluation, first the first
Zhou 51 friend a piece of code to ask me, said he could not understand this code, think that this code has a problem, the code is similar:
The code is as follows
Copy Code
$array 1 = Array (1, 2);$array 2 = Array (3, 4);$
Priority Level
operator
Description
Example
combination of
1
()[]->.::++--
Bracket operator for adjusting precedenceArray Subscript access operatorTo access a member's operator by pointing to an object's pointerTo
Priority level
Operator
Name or meaning
Use form
Combining direction
Description
1
[]
Array subscript
array name [constant expression]
Left to right
()
Parentheses
(expression)/
Regular expressions are evaluated from left to right and follow the order of precedence, which is very similar to an arithmetic expression.
The same priority of the operation from left to right, the operation of different priorities first high and
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
1, what is the priority of Python 2, Python priority use combat
The role of priority
The execution of a program or operator in Python is sequential, such as A and B, and if a can take precedence over B, then the priority of a is higher than B, and
Priority level
Operator
Name or meaning
Use form
Combining direction
Description
1
[]
Array subscript
array name [constant expression]
Left to right
()
Parentheses
(expression)/
Python Conditional Statements
A python conditional statement determines the code block that executes by executing the result of one or more statements (true or false).
You can easily understand the execution of conditional statements by:
The
= ' hdj ' - = ' deeka ' (- (?>Access control for a property or method is achieved by adding the keyword public, protected, or private earlier. A class member defined by public can be accessed anywhere, and a class
Use recursive methods to calculate the lastvt set
// 0505 lastvt. cpp: defines the entry point for the console application Program . // # include "stdafx. H " # include # include using namespace STD; # define length 5 // length of the
Priority level
Operator
Name or meaning
Use form
Combination direction
Description
1
[]
Array subscript
array name [constant expression]
Left to right
()
Simple method to calculate the precedence function
Manual calculations are cumbersome and error-prone.
By definition, computer-based, fast and convenient, accurate and expandable
0505 precedence function. cpp: The entry point that defines the
1. Demand AnalysisDesign a program to demonstrate the process of evaluation of arithmetic expressions using operator precedence. Using the operator precedence relation, the evaluation of the arithmetic four mixed operation expression is realized.
(1)
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.