当前位置:网站首页>In depth analysis of C language - variable error prone knowledge points # dry goods inventory #
In depth analysis of C language - variable error prone knowledge points # dry goods inventory #
2022-07-02 03:22:00 【Konjak_ Konnyaku】
Variables are very basic content , But be sure to master !
3.1. What is a variable
3.2. How to define variables - How to use it?
3.3 Why define variables
Computers are born to solve the problem of people's lack of computing power . namely , Computers are for calculation .
And calculation , You need data .
And to calculate , Any moment , Not all data should be calculated immediately .Why variables are needed ? Because there is data that needs to be saved temporarily , Waiting for further processing
3.4 The essence of variable definition
- The program runs , It needs to be loaded into memory
- Program calculation , You need to use variables
The essence of variable definition : Open up a space in memory , To hold data ( Why must it be memory : Because defining variables , It's also part of program logic , The program has been loaded into memory )
3.5 The nature of variable declarations
Declared variables are usually added extern keyword :
Be careful : Cannot initialize when declaring
The declaration even tells the compiler , This variable is defined elsewhere , Declarations do not allocate memory space to variables !!
3.6 About the difference between declaration and definition
difference : The definition has memory allocation , Declaration has no memory allocation
Be careful : Cannot initialize when declaring
Statement
The declaration just tells the compiler that there is such a variable or function , This function or variable is defined in other places , So in this process, no memory is allocated again , Therefore, a declaration can be declared more than once ;
Definition
A program opens up memory space for its variables or functions at run time , Definition can only be defined once .
As for initialization , Is to complete the development of memory space , Fill in the specified value for the memory opened up .
边栏推荐
- [HCIA continuous update] working principle of OSPF Protocol
- Use blocking or non blocking for streamline
- 焱融看 | 混合云时代下,如何制定多云策略
- QT environment generates dump to solve abnormal crash
- Named block Verilog
- 流线线使用阻塞还是非阻塞
- 跟着CTF-wiki学pwn——ret2shellcode
- [golang] leetcode intermediate bracket generation & Full Permutation
- Global and Chinese markets for hand hygiene monitoring systems 2022-2028: Research Report on technology, participants, trends, market size and share
- What is the binding path of SAP ui5
猜你喜欢
Force deduction daily question 540 A single element in an ordered array
halcon图像矫正
Uniapp uses canvas to generate posters and save them locally
浅谈线程池相关配置
[HCIA continuous update] overview of dynamic routing protocol
图扑软件通过 CMMI5 级认证!| 国际软件领域高权威高等级认证
Learn PWN from CTF wiki - ret2shellcode
[JS reverse series] analysis of a customs publicity platform
焱融看 | 混合云时代下,如何制定多云策略
Screenshot literacy tool download and use
随机推荐
Kotlin 基础学习13
初出茅庐市值1亿美金的监控产品Sentry体验与架构
Discussion on related configuration of thread pool
OSPF LSA message parsing (under update)
venn图取交集
[database]jdbc
Large screen visualization from bronze to the advanced king, you only need a "component reuse"!
PHP array processing
焱融看 | 混合云时代下,如何制定多云策略
Retrofit's callback hell is really vulnerable in kotlin synergy mode
SAML2.0 notes (I)
Delphi xe10.4 installing alphacontrols15.12
Redis set command line operation (intersection, union and difference, random reading, etc.)
KL divergence is a valuable article
ORA-01547、ORA-01194、ORA-01110
2022 hoisting machinery command examination paper and summary of hoisting machinery command examination
数据传输中的成帧
Kotlin基础学习 16
What is the binding path of SAP ui5
Merge interval, linked list, array