当前位置:网站首页>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 .
边栏推荐
- What is the binding path of SAP ui5
- [HCIA continuous update] working principle of OSPF Protocol
- Baohong industry | 6 financial management models at different stages of life
- Sentry experience and architecture, a fledgling monitoring product with a market value of $100million
- 终日乾乾,夕惕若厉
- Design details of SAP e-commerce cloud footernavigationcomponent
- Verilog 避免 Latch
- Principle of computer composition - interview questions for postgraduate entrance examination (review outline, key points and reference)
- How to develop digital collections? How to develop your own digital collections
- JDBC details
猜你喜欢

图扑软件通过 CMMI5 级认证!| 国际软件领域高权威高等级认证

Verilog state machine

MySQL advanced (Advanced) SQL statement (II)

One of the future trends of SAP ui5: embrace typescript

Yan Rong looks at how to formulate a multi cloud strategy in the era of hybrid cloud

焱融看 | 混合云时代下,如何制定多云策略

Cache processing scheme in high concurrency scenario

只需简单几步 - 开始玩耍微信小程序

Exchange rate query interface

Download and use of the super perfect screenshot tool snipaste
随机推荐
Sentry experience and architecture, a fledgling monitoring product with a market value of $100million
venn圖取交集
Common means of modeling: aggregation
C # joint Halcon's experience of breaking away from Halcon environment and various error reporting solutions
Qualcomm platform WiFi -- P2P issue (2)
Verilog 过程赋值 区别 详解
知物由学 | 自监督学习助力内容风控效果提升
Retrofit's callback hell is really vulnerable in kotlin synergy mode
Start a business
How to develop digital collections? How to develop your own digital collections
IPhone 6 plus is listed in Apple's "retro products" list
Calculation of page table size of level 2, level 3 and level 4 in protection mode (4k=4*2^10)
Verilog avoid latch
Just a few simple steps - start playing wechat applet
Eight steps of agile development process
[JS reverse series] analysis of a customs publicity platform
MySQL connection query and subquery
[HCIA continuous update] overview of dynamic routing protocol
Qualcomm platform wifi-- WPA_ supplicant issue
Global and Chinese market of handheld ultrasonic scanners 2022-2028: Research Report on technology, participants, trends, market size and share