当前位置:网站首页>What is definition? What is a statement? What is the difference between them?
What is definition? What is a statement? What is the difference between them?
2022-07-03 07:45:00 【It's Beichen not too PI acridine】
What is the definition ? What is a statement ? What's the difference between them ?
What is the definition ?
What is the definition : The so-called definition is ( compiler ) Create an object , Allocate a piece of memory for this object and give it a name , This name is what we often call variable name or object name . But pay attention to , Once the name matches this memory , They live and die together , Never give up . And the location of this memory cannot be changed . A variable or object is in a certain area ( For example, in a function , Global, etc ) Can only be defined once , If defined more than once , The compiler will prompt you to define the same variable or object repeatedly .
int i;
What is a statement ?
What is a statement : It has two meanings , as follows :
First meaning : Tell compiler , The name has been matched to a piece of memory , The following code uses variables or objects that are defined elsewhere . Statements can appear more than once .
extern int i;
Second meaning : Tell compiler , I made a reservation for my name , It can no longer be used as a variable name or object name anywhere else . For example, you put a book on a seat in the self-study room of the Library , It indicates that this seat has been reserved , No one is allowed to use this seat anymore . In fact, you are not sitting in this seat at this time . The most typical example of this kind of declaration is the declaration of function parameters , for example :
void fun(int i, char c);
What's the difference ?
The definition is to allocate memory space .
Declare that there is no need to allocate memory space .
边栏推荐
- 项目经验分享:基于昇思MindSpore,使用DFCNN和CTC损失函数的声学模型实现
- Paper learning -- Study on the similarity of water level time series of Xingzi station in Poyang Lake
- 【MindSpore论文精讲】AAAI长尾问题中训练技巧的总结
- OSPF protocol summary
- Pat class a 1028 list sorting
- [MySQL 13] if you change your password for the first time after installing mysql, you can skip MySQL password verification to log in
- Harmonyos third training notes
- Structure of golang
- 技术干货|昇思MindSpore NLP模型迁移之Bert模型—文本匹配任务(二):训练和评估
- The concept of C language pointer
猜你喜欢
Technical dry goods | reproduce iccv2021 best paper swing transformer with Shengsi mindspire
PAT甲级 1028 List Sorting
Harmonyos third training notes
Go language foundation ----- 03 ----- process control, function, value transfer, reference transfer, defer function
The concept of C language pointer
[coppeliasim4.3] C calls UR5 in the remoteapi control scenario
技术干货|利用昇思MindSpore复现ICCV2021 Best Paper Swin Transformer
一篇文章让你读懂-曼彻斯特编码
Epoll related references
PAT甲级 1031 Hello World for U
随机推荐
Pgadmin 4 v6.11 release, PostgreSQL open source graphical management tool
What did the DFS phase do
Project experience sharing: realize an IR Fusion optimization pass of Shengsi mindspire layer
Technical dry goods Shengsi mindspire lite1.5 feature release, bringing a new end-to-end AI experience
yarn link 是如何帮助开发者对 NPM 包进行 debug 的?
Vertx's responsive redis client
Structure of golang
Segment read
项目经验分享:实现一个昇思MindSpore 图层 IR 融合优化 pass
【MindSpore论文精讲】AAAI长尾问题中训练技巧的总结
PDO and SDO concepts
C2-关于VCF文件合并的几种方法
技术干货|昇思MindSpore NLP模型迁移之Roberta ——情感分析任务
Mail sending of vertx
技术干货|AI框架动静态图统一的思考
OSPF experiment
Pat class a 1032 sharing
Sent by mqtt client server of vertx
Go language foundation ----- 19 ----- context usage principle, interface, derived context (the multiplexing of select can be better understood here)
研究显示乳腺癌细胞更容易在患者睡觉时进入血液