当前位置:网站首页>Left and right values
Left and right values
2022-06-23 04:48:00 【Boundless also initial heart】
C/C++ Variables that can be placed to the left of the assignment symbol in the language , Left values represent objects stored in computer memory , The left value is equivalent to the address value . Right value : When a symbol or constant is placed to the right of the operator , Just read their computers “ Right value ”, That is, the real value it represents , The right value is equivalent to the data value .
L-value and R-value basic information
C/C++ Variables that can be placed to the left of the assignment symbol in the language , That is, it has a corresponding storage unit that can be accessed by the user , And it can be changed by the user . Left values represent objects stored in computer memory , Instead of constants or calculated results . Or the left value represents a memory address value , And through this memory address , You can read and write to the memory ( Mainly can write ) operation ; That's why left values can be assigned . And the corresponding right value : When a symbol or constant is placed to the right of the operator , Just read their computers “ Right value ”, That is, the real value it represents . In a nutshell , The left value is equivalent to the address value , The right value is equivalent to the data value . The right value refers to a reference to a data stored in a memory address .
Examples
such as : int ia,ib;
ib=0;
ia=ib;
ad locum , First define ia,ib. Then on ib assignment , At this time, the computer takes ib Left value of , That is, the memory location represented by this symbol, that is, the memory address value , Computer access 0 The right value , That's the number 0; And then to ia The assignment is ib, At this time take ib The right value of is given to ia Left value of ;
So ,ib Left value of 、 The right value is based on his position ;
This is an interesting part of formal language .
Application attention
Left value right value translation :
L-value Medium L refer to Location, Represents addressable .Avalue (computer science)that has an address.
R-value Medium R refer to Read, Means to read .in computer science, a value that does not have an address in a computer language.
Left and right values are relative to assignment expressions . An lvalue is an expression that can appear to the left of an assignment expression . Lvalue expressions can be divided into read-write lvalues and read-only lvalues . A right value is an expression that can appear to the right of an assignment expression , It can be a temporary amount or a literal amount that doesn't occupy memory space , It can be a spatial entity with no write right . Such as
int a=3;
const int b=5;
a=b+2; //a It's left ,b+2 It's right value
b=a+2; // wrong !b Is a read-only lvalue but has no write rights , Cannot appear to the left of the assignment symbol
(a=4)+=28; //a=4 It's an lvalue expression ,28 It's right value ,+= For assignment operators
34=a+2; // wrong !34 The literal quantity can't be left value
边栏推荐
- 395. 冗余路径
- Openjudge noi 1.13 50: several
- Tiktok x-bogus and_ Signature parameter analysis
- laravel 8.4 路由问题,结尾处是编辑器左侧对照表,小白可看懂
- Examples of corpus data processing cases (part of speech encoding, part of speech restoration)
- Permission Operation in dynamics 365 plug-in
- 2020:VL-BERT: Pre-training of generic visual-linguistic representation
- TS advanced infer
- thinkPHP6解决跳转问题
- Dpr-34v/v two position relay
猜你喜欢

Transformers中的动态学习率

Static two position relay xjls-84/440/dc220v

国家药品不良反应监测中心 ADR 电子传输EDI解决方案

使用Live Chat促进业务销售的惊人技巧

CAN总线基础知识

离线数仓建模中常见的概念-术语

What are the characteristics of SRM supplier management system developed by manufacturing enterprises

Leetcode 1208. Try to make the strings equal as much as possible (finally solved, good night)

laravel 8.4 路由问题,结尾处是编辑器左侧对照表,小白可看懂

Distance measure - cosine distance
随机推荐
20000 words + 20 pictures | details of nine data types and application scenarios of redis
Halcon knowledge: binocular_ Discrimination knowledge
X24cxx series EEPROM chip C language universal reading and writing program
[pytoch] calculate the derivative of sin (x) by automatic differentiation
Abnova酸性磷酸酶(小麦胚芽)说明书
Pta:7-58 Book audio-visual rental management
cadence中的焊盘和flash symbol
Abnova 荧光染料 555-C3 马来酰亚胺方案
zk 有一个节点报 It is probably not running且日志无明显报错
关于php里tcp通讯用swoole框架出现的小问题
Ms-fsrvp forced abuse of POC
Abnova ACTN4纯化兔多克隆抗体说明书
电流继电器HDL-A/1-110VDC-1
Audio and video development journey (63) - animation and rendering of Lottie source code analysis
离线数仓建模中常见的概念-术语
在PCB板边走高频高速信号线的注意事项–高频高速信号设计基本原则
电流继电器JDL-1002A
Pta:7-31 journal charges
OpenJudge NOI 1.13 50:数根
#18生成器函数的参数传递