当前位置:网站首页>2.3 learning content
2.3 learning content
2022-07-05 15:25:00 【Houli crab 670】
- Local and global variables
- The scope and life cycle of variables
- stay VS2021 Use traditional scanf The reason for the warning
The priority of local variables and global variables and how to distinguish
When the variables of local variables and global variables are the same , Meeting “ Local priority global ”
Generally speaking , Inside the braces are local variables , Outside the braces are global variables ( I used to think that global variables are also in the main function , Today, I learned that it is a local variable )
The scope and life cycle of variables
Scope , Generally speaking, it is the range of variables . The life cycle is the period of time from the definition of a variable to leaving its function .
About the scope of variables , If you define a variable in a source file (int a) Then I also want to use this variable in another source file , Direct write extern int a. Then you can use it .
scanf The reason for the warning
because scanf It doesn't care about the string you enter ( Or numbers ) Whether it exceeds the originally defined space . For example, I define a character array (char a[5]) But I input more than five characters (ashdjdjj), The result of running is not ashdj It is ashdjdjj, And the program will crash . Simply put “ The function has insufficient restrictions on the type and number of parameters .”( I found it online haha , Chinese is not good , Language is not refined )
边栏推荐
- Huiyuan, 30, is going to have a new owner
- 可视化任务编排&拖拉拽 | Scaleph 基于 Apache SeaTunnel的数据集成
- Brief introduction of machine learning framework
- Explanation report of the explosion
- mapper. Comments in XML files
- Can I pass the PMP Exam in 20 days?
- P6183 [USACO10MAR] The Rock Game S
- Stm32+bh1750 photosensitive sensor obtains light intensity
- DVWA range clearance tutorial
- P6183 [USACO10MAR] The Rock Game S
猜你喜欢
【jvm】运算指令
Surpass palm! Peking University Master proposed diverse to comprehensively refresh the NLP reasoning ranking
Common redis data types and application scenarios
Coding devsecops helps financial enterprises run out of digital acceleration
sql server学习笔记
I spring and autumn blasting-2
Explanation report of the explosion
Huiyuan, 30, is going to have a new owner
你童年的快乐,都是被它承包了
ionic cordova项目修改插件
随机推荐
Usage and usage instructions of JDBC connection pool
Where is the operation of convertible bond renewal? Is it safer and more reliable to open an account
keep-alive
Ctfshow web entry command execution
queryRunner. Query method
OSI seven layer model
Nine hours, nine people, nine doors problem solving Report
Misc Basic test method and knowledge points of CTF
[JVM] operation instruction
Install PHP extension spoole
Optional parameters in the for loop
Fr exercise topic - simple question
复现Thinkphp 2.x 任意代码执行漏洞
Your childhood happiness was contracted by it
P1451 求细胞数量/1329:【例8.2】细胞
计算中间件 Apache Linkis参数解读
Fr exercise topic --- comprehensive question
Select sort and bubble sort
Redis distributed lock principle and its implementation with PHP (1)
Magic methods and usage in PHP (PHP interview theory questions)