当前位置:网站首页>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 )
边栏推荐
- Appium自动化测试基础 — APPium基础操作API(二)
- Thymeleaf uses background custom tool classes to process text
- wxml2canvas
- Bugku easy_ nbt
- Example of lvgl display picture
- Aike AI frontier promotion (7.5)
- 【jvm】运算指令
- First PR notes
- Transfer the idea of "Zhongtai" to the code
- Ten billion massage machine blue ocean, difficult to be a giant
猜你喜欢

30岁汇源,要换新主人了

P1451 求细胞数量/1329:【例8.2】细胞

I spring web upload

swiper. JS to achieve barrage effect

I spring and autumn blasting-2

Detailed explanation of QT creator breakpoint debugger

Interpretation of Apache linkage parameters in computing middleware

Number protection AXB function! (essence)

Creation and optimization of MySQL index

Database learning - Database Security
随机推荐
qt creater断点调试程序详解
Bugku alert
1330: [example 8.3] minimum steps
ionic cordova项目修改插件
JS topic - console log()
Reproduce ThinkPHP 2 X Arbitrary Code Execution Vulnerability
I spring and autumn blasting-2
Can I pass the PMP Exam in 20 days?
百亿按摩仪蓝海,难出巨头
Database learning - Database Security
Reasons and solutions for redis cache penetration and cache avalanche
Cartoon: programmers don't repair computers!
Aike AI frontier promotion (7.5)
[recruitment position] infrastructure software developer
"Sequelae" of the withdrawal of community group purchase from the city
swiper. JS to achieve barrage effect
Fr exercise topic --- comprehensive question
Bugku's Eval
Mysql---- function
Redis' transaction mechanism