当前位置:网站首页>Introduction to expressions and operators in C language
Introduction to expressions and operators in C language
2022-07-01 09:37:00 【Jingqiang Mingxi Linlang 0531】
1、 Expressions are like the mathematical formulas used in ordinary learning , By operator (operator) And operands (operand) form .
Operands include constants 、 Variable 、 Function calls and other expressions .
Operators have assignment operators , Arithmetic operator , Comparison operator , Logical operators 、 Increment decrement operator 、 An operator 6 Kind of .
Examples are as follows :
y=520x+a*b+1/camong =、+、*、/ Symbols belong to operators , constant 520, Variable y,x,a,b,c Belongs to operand .
2、C Expressions in the language use the middle order method , At the same time, it will also involve the priority and associativity of operators .
Middle order method (Infix): Operator between two operands , for example a+b、(a+b)*(c+d) And so on are all middle order representations .
3、C Language expressions can be divided into... According to the number of operands handled by operators “ A unary expression ”、“ Binary expression ” and “ Ternary expression ”3 Kind of .

4、C The calculation priority of various operators in the language is shown in the following table :
| Operator precedence | explain |
| () | Brackets , From left to right |
| [ ] | square brackets , From left to right |
! - | Logical operations NOT Minus sign |
| ~ | An operator , From right to left |
| ++、-- | Increasing and decreasing operations , From right to left |
* / % | Multiplication Division operations Remainder operation 、 From left to right |
+ - | Addition operation Subtraction |
<< >> | Bit left operation Bitwise right operation |
> >= < <= == != | Comparison operations , Greater than Comparison operations , Greater than or equal to Comparison operations , Less than Comparison operations , Less than or equal to Comparison operations , be equal to Comparison operations , It's not equal to , From left to right |
& ^ | | An operation AND, From left to right An operation XOR( Exclusive or ) An operation OR, From left to right |
&& || | Logical operations AND Logical operations OR, From left to right |
?: | Conditional operation , From right to left |
| = | The assignment operation , From right to left |
This column also has a summary and sharing of operators , Ongoing update , To be continued ……
边栏推荐
- Tree structure -- binary tree 2 non recursive traversal
- MapReduce programming basics
- 集成积木报表报错 org.apache.catalina.core.StandardContext.filterStart 启动过滤器异常
- [unity shader] substitution of bool type in the property definition
- js作用域链与闭包
- Mikrotik Routeros Internet access settings
- 2.3 [kaggle dataset - dog feed example] data preprocessing, rewriting dataset, dataloader reading data
- SQL learning notes (03) -- data constraint relationship
- 【pytorch】nn. AdaptiveMaxPool2d
- PHP array functions (merge, split, append, find, delete, etc.)
猜你喜欢
随机推荐
一个悄然崛起的国产软件,低调又强大!
IPv6 learning notes
JS prototype trap
js函数arguments对象
JS scope chain and closure
富文本实现插值
SDN_ Simple summary
JS variable lifting
dsPIC30F6014a LCD 方块显示
PHP merges multiple arrays. The same element takes the intersection of different elements to form an array
炒币,亏了1000万。
Nacos service configuration and persistence configuration
2.2 【pytorch】torchvision. transforms
Matrix and coordinates
js重写自己的函数
Design and manufacture of simple digital display electronic scale
SDN_简单总结
手指点击屏幕就模拟进入F11进入全屏
JS use toString to distinguish between object and array
【检测技术课案】简易数显电子秤的设计与制作









