当前位置:网站首页>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 .
边栏推荐
- Go language foundation ----- 18 ----- collaboration security, mutex lock, read-write lock, anonymous lock, sync Once
- Shengsi mindspire is upgraded again, the ultimate innovation of deep scientific computing
- Lucene introduces NFA
- PHP常用排序算法
- 华为交换机基础配置(telnet/ssh登录)
- Partage de l'expérience du projet: mise en œuvre d'un pass optimisé pour la fusion IR de la couche mindstore
- Analysis of the problems of the 11th Blue Bridge Cup single chip microcomputer provincial competition
- experiment.........
- 基于RNA的新型癌症疗法介绍
- Segment read
猜你喜欢

Unity XR实现交互(抓取,移动旋转,传送,射击)-Pico

【LeetCode】4. Best time to buy and sell stock

Pat class a 1032 sharing

HarmonyOS第三次培训笔记

Go language foundation ------ 14 ------ gotest

The concept of C language pointer

【LeetCode】4. Best Time to Buy and Sell Stock·股票买卖最佳时机

Technical dry goods Shengsi mindspire innovation model EPP mvsnet high-precision and efficient 3D reconstruction

Go language foundation ----- 18 ----- collaboration security, mutex lock, read-write lock, anonymous lock, sync Once

HCIA notes
随机推荐
Image recognition and detection -- Notes
Segment read
Technical dry goods Shengsi mindspire elementary course online: from basic concepts to practical operation, 1 hour to start!
技术干货|百行代码写BERT,昇思MindSpore能力大赏
Leetcode 213: looting II
Technical dry goods | hundred lines of code to write Bert, Shengsi mindspire ability reward
Go language foundation ----- 09 ----- exception handling (error, panic, recover)
Web router of vertx
Go language foundation ----- 16 ----- goroutine, GPM model
Pat class a 1031 Hello world for u
What did the DFS phase do
【MySQL 12】MySQL 8.0.18 重新初始化
PAT甲级 1028 List Sorting
Redis查看客户端连接
Go language foundation ----- 08 ----- interface
【LeetCode】4. Best time to buy and sell stock
华为S5700交换机初始化和配置telnet,ssh用户方法
Lucene merge document order
Traversal in Lucene
[mindspire paper presentation] summary of training skills in AAAI long tail problem