当前位置:网站首页>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/c
among =、+、*、/ 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 ……
边栏推荐
- Closure implementation iterator effect
- The market is relatively weak recently
- Mise en œuvre simple de l'équilibrage de la charge par nacos
- Concept of digital currency
- delete和delete[]引发的问题
- MapReduce programming basics
- JS variable lifting
- SQL learning notes (03) -- data constraint relationship
- Computer USB, HDMI, DP various interfaces and speeds
- 我喜欢两个男人。。。
猜你喜欢
那个程序员,被打了。
Learning practice: comprehensive application of cycle and branch structure (II)
js作用域链与闭包
How to realize the usage of connecting multiple databases in idel
【pytorch】softmax函数
IPv6 learning notes
JS原型链
Design and manufacture of simple digital display electronic scale
dsPIC30F6014a LCD 方块显示
Network counting 01 physical layer
随机推荐
Short circuit operator lazy evaluation
dsPIC30F6014a LCD 方块显示
SDN_简单总结
Record a redis timeout
dotnet 控制台 使用 Microsoft.Maui.Graphics 配合 Skia 进行绘图入门
JS use toString to distinguish between object and array
Hololens2 development -6-eyetracking and speech recognition
闭包实现迭代器效果
js变量提升(hoisting)
树结构---二叉树2非递归遍历
nacos简易实现负载均衡
SDN_ Simple summary
项目采购管理
ES6 decoupling top-level objects from windows
Network counting 01 physical layer
队列的实现和应用
Swift control encapsulation - paging controller
Flinkv1.13实现金融反诈骗案例
韦东山板子编译内核问题解决
Closure implementation iterator effect