当前位置:网站首页>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 .
边栏推荐
- Docker安装canal、mysql进行简单测试与实现redis和mysql缓存一致性
- 旋转框目标检测mmrotate v0.3.1 学习模型
- 跟着CTF-wiki学pwn——ret2shellcode
- Apple added the first iPad with lightning interface to the list of retro products
- This article describes the step-by-step process of starting the NFT platform project
- West digital decided to raise the price of flash memory products immediately after the factory was polluted by materials
- verilog 并行块实现
- 终日乾乾,夕惕若厉
- Exchange rate query interface
- verilog REG 寄存器、向量、整数、实数、时间寄存器
猜你喜欢

Redis cluster

Detailed explanation of the difference between Verilog process assignment
![[JS reverse series] analysis of a customs publicity platform](/img/15/fdff7047e789d4e7c3c273a2f714f3.jpg)
[JS reverse series] analysis of a customs publicity platform

Cache processing scheme in high concurrency scenario

Force deduction daily question 540 A single element in an ordered array

Design details of SAP e-commerce cloud footernavigationcomponent

小米青年工程师,本来只是去打个酱油

Docker安装canal、mysql进行简单测试与实现redis和mysql缓存一致性

Knowing things by learning | self supervised learning helps improve the effect of content risk control

One of the future trends of SAP ui5: embrace typescript
随机推荐
3124. Word list
Common means of modeling: aggregation
Baohong industry | four basic knowledge necessary for personal finance
浅谈线程池相关配置
Grpc快速实践
Global and Chinese market of autotransfusion bags 2022-2028: Research Report on technology, participants, trends, market size and share
What is the binding path of SAP ui5
小米青年工程师,本来只是去打个酱油
Qualcomm platform WiFi -- Native crash caused by WiFi
On redis (II) -- cluster version
JIT deep analysis
Verilog 状态机
Kotlin基础学习 16
uniapp 使用canvas 生成海报并保存到本地
Verilog avoid latch
2022 hoisting machinery command examination paper and summary of hoisting machinery command examination
流线线使用阻塞还是非阻塞
JS introduction < 1 >
C#联合halcon脱离halcon环境以及各种报错解决经历
GB/T-2423.xx 环境试验文件,整理包括了最新的文件里面