当前位置:网站首页>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 )
边栏推荐
- 数据库学习——数据库安全性
- Creation and use of thymeleaf template
- "Sequelae" of the withdrawal of community group purchase from the city
- Can I pass the PMP Exam in 20 days?
- Ctfshow web entry explosion
- Reconnaissance des caractères easycr
- 亿咖通科技通过ISO27001与ISO21434安全管理体系认证
- 华为哈勃化身硬科技IPO收割机
- Example of lvgl display picture
- First PR notes
猜你喜欢

Thymeleaf uses background custom tool classes to process text

Bugku alert

NBA赛事直播超清画质背后:阿里云视频云「窄带高清2.0」技术深度解读

Ten billion massage machine blue ocean, difficult to be a giant

Detailed explanation of QT creator breakpoint debugger

Interpretation of Apache linkage parameters in computing middleware

Crud of MySQL

lv_font_conv离线转换

华为哈勃化身硬科技IPO收割机
![[12 classic written questions of array and advanced pointer] these questions meet all your illusions about array and pointer, come on!](/img/d2/c0a19c85b2011ecd07c9944d996c4d.png)
[12 classic written questions of array and advanced pointer] these questions meet all your illusions about array and pointer, come on!
随机推荐
Severlet learning foundation
How can the boss choose programmers to help me with development?
Bugku alert
市值蒸发超百亿美元,“全球IoT云平台第一股”赴港求生
Live broadcast preview | how to implement Devops with automatic tools (welfare at the end of the article)
Bugku telnet
漫画:程序员不是修电脑的!
Example of lvgl display picture
百亿按摩仪蓝海,难出巨头
Huiyuan, 30, is going to have a new owner
Hongmeng system -- Analysis from the perspective of business
复现Thinkphp 2.x 任意代码执行漏洞
超越PaLM!北大碩士提出DiVeRSe,全面刷新NLP推理排行榜
Common MySQL interview questions
Stm32+bh1750 photosensitive sensor obtains light intensity
Redis distributed lock principle and its implementation with PHP (2)
"Sequelae" of the withdrawal of community group purchase from the city
Calculate weight and comprehensive score by R entropy weight method
Redis' transaction mechanism
Reproduce ThinkPHP 2 X Arbitrary Code Execution Vulnerability