当前位置:网站首页>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 )
边栏推荐
- Ctfshow web entry command execution
- Stm32+bh1750 photosensitive sensor obtains light intensity
- ICML 2022 | explore the best architecture and training method of language model
- I spring and autumn blasting-2
- MySQL表字段调整
- Number protection AXB function! (essence)
- Transfer the idea of "Zhongtai" to the code
- [JVM] operation instruction
- mapper. Comments in XML files
- Bugku's Ah Da
猜你喜欢
随机推荐
Optional parameters in the for loop
Your childhood happiness was contracted by it
How to introduce devsecops into enterprises?
1330: [example 8.3] minimum steps
JS knowledge points-01
go学习 ------jwt的相关知识
CODING DevSecOps 助力金融企业跑出数字加速度
ionic cordova项目修改插件
mapper. Comments in XML files
Ctfshow web entry explosion
Surpass palm! Peking University Master proposed diverse to comprehensively refresh the NLP reasoning ranking
First PR notes
Easyocr character recognition
MySQL表字段调整
GPS original coordinates to Baidu map coordinates (pure C code)
机器学习框架简述
可视化任务编排&拖拉拽 | Scaleph 基于 Apache SeaTunnel的数据集成
Stop B makes short videos, learns Tiktok to die, learns YouTube to live?
美团优选管理层变动:老将刘薇调岗,前阿里高管加盟
Redis' transaction mechanism