MindMap Gallery C language operators and expressions
This mind map explains in detail the operators and expressions in C language. An operator is a symbol that tells the compiler to perform a specific mathematical or logical operation. C language has rich built-in operators. Understanding operators and expressions is the basis of programming, come and download and learn
Edited at 2023-11-09 22:54:51El cáncer de pulmón es un tumor maligno que se origina en la mucosa bronquial o las glándulas de los pulmones. Es uno de los tumores malignos con mayor morbilidad y mortalidad y mayor amenaza para la salud y la vida humana.
La diabetes es una enfermedad crónica con hiperglucemia como signo principal. Es causada principalmente por una disminución en la secreción de insulina causada por una disfunción de las células de los islotes pancreáticos, o porque el cuerpo es insensible a la acción de la insulina (es decir, resistencia a la insulina), o ambas cosas. la glucosa en la sangre es ineficaz para ser utilizada y almacenada.
El sistema digestivo es uno de los nueve sistemas principales del cuerpo humano y es el principal responsable de la ingesta, digestión, absorción y excreción de los alimentos. Consta de dos partes principales: el tracto digestivo y las glándulas digestivas.
El cáncer de pulmón es un tumor maligno que se origina en la mucosa bronquial o las glándulas de los pulmones. Es uno de los tumores malignos con mayor morbilidad y mortalidad y mayor amenaza para la salud y la vida humana.
La diabetes es una enfermedad crónica con hiperglucemia como signo principal. Es causada principalmente por una disminución en la secreción de insulina causada por una disfunción de las células de los islotes pancreáticos, o porque el cuerpo es insensible a la acción de la insulina (es decir, resistencia a la insulina), o ambas cosas. la glucosa en la sangre es ineficaz para ser utilizada y almacenada.
El sistema digestivo es uno de los nueve sistemas principales del cuerpo humano y es el principal responsable de la ingesta, digestión, absorción y excreción de los alimentos. Consta de dos partes principales: el tracto digestivo y las glándulas digestivas.
Operators and expressions
equality operator
Include
==
!=
Features
Allows comparison of operands of different types
Combining rules
left union
priority
Logical between relational operators and assignment operators
Relational operators
Relational operators
effect
Compare two quantities
Include
<
>
<=
>=
priority
Between arithmetic operators and equality operators
Features
Allows comparison of operands of different types
Combining rules
left union
error-prone
i>j>k -> (i>j)>k
relational expression
Use relational operators to connect two expressions into meaningful sentences
the value of a relational expression
1(true)
0(false)
Logical Operators
Include
&&and
value
Total truth is true
One holiday, all holidays
priority
Between the equality operator and the assignment operator
Combining rules
left union
||or
value
One truth, all truth
All false is false
priority
Between the equality operator and the assignment operator
Combining rules
left union
!No
value
Either true or false
either false or true
priority
Between increment/decrement and arithmetic operators
Combining rules
right union
Short circuit calculation
The operation result can be derived based on the left operand, and there is no need to calculate the right operand.
logical expression
concept
Use logical operators to connect one or two expressions into meaningful expressions
Result value
When the value of the expression is a relational or equality expression, the value of the expression is 0 or 1
When the expression is an ordinary expression, a non-zero value is true and a zero value is false.
arithmetic expression
unary arithmetic operator
unary minus operator
Unary plus sign operator (generally not used)
binary arithmetic operators
add
Adding integers and integers
Adding integers and floating point numbers
The operands can be two variables, two constants, one variable and one constant
/division
The operands are all integers, and the result is an integer (the decimal part is discarded, that is, rounded to zero)
When at least one operand is a floating point number, the result does not need to be rounded.
When the divisor is 0, there will be a compilation warning, but no error will be reported.
Take remainder
Operands are all integers
When the divisor is 0, there will be a compilation warning, but no error will be reported.
The operands have negative numbers, and the sign of the result is the same as the left operand.
Increment and decrement operators
/--
Prefix usage
i,--i
i (first) increases or decreases immediately
Suffix usage
i,i--
i last increments or decrements
assignment expression
Symbol: =
Meaning: Assign the value on the right to the left
Simple assignment
v=e
e can be a variable, constant, or expression
Assigning a floating point number to an integer variable rounds towards zero
v and e are different types. The assignment operator will convert the type of e into the type of v.
Multiple assignment (concatenated assignment)
Multiple assignment operators used together
Cannot be written where the variable is declared
Right associative (i.e. operating from right to left)
Use with caution
compound assignment
common
v=e
Add e to v and store the result in v
v-=e
Subtract e from v and store the result in v
v*=e
Multiply v by e and store the result in v
v/=e
Divide v by e and store the result in v
v%=e
Divide v by e and take the remainder, then store the result in v
e can be a constant variable expression
error-prone
i= j -> i=( i)
Pay attention to the writing of symbols
i*=a b -> i=i*(a b)
e is the operation involving the whole
other
<<=
>>=
&=
^=
|=
lvalue
Represents an object that occupies storage space in computer memory
constant or expression is not an lvalue
Variable is an lvalue
The left operand of an assignment operator must be an lvalue
Expression evaluation and expression statements
The precedence of operations for expression evaluation
Prefix increment/decrement>suffix increment/decrement=unary operator>multiplication class>addition class>assignment operation
error-prone
k=i j -> k=(i ) j
k= j i j ->
j
k=j i j
i
The way to convert an expression into a statement is to add a semicolon at the end;