当前位置:网站首页>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 )
边栏推荐
- ICML 2022 | 探索语言模型的最佳架构和训练方法
- Leetcode: Shortest Word Distance II
- F. Min cost string problem solving Report
- Good article inventory
- Talk about your understanding of microservices (PHP interview theory question)
- OSI seven layer model
- Bugku's eyes are not real
- mapper.xml文件中的注释
- 12 MySQL interview questions that you must chew through to enter Alibaba
- 超越PaLM!北大碩士提出DiVeRSe,全面刷新NLP推理排行榜
猜你喜欢

Machine learning notes - gray wolf optimization

Live broadcast preview | how to implement Devops with automatic tools (welfare at the end of the article)

12 MySQL interview questions that you must chew through to enter Alibaba

JS knowledge points-01

把 ”中台“ 的思想迁移到代码中去

Good article inventory

做研究无人咨询、与学生不交心,UNC助理教授两年教职挣扎史

Bugku's Eval

MySQL之CRUD

Visual task scheduling & drag and drop | scalph data integration based on Apache seatunnel
随机推荐
Redis' transaction mechanism
MySQL----函数
Hongmeng system -- Analysis from the perspective of business
做研究无人咨询、与学生不交心,UNC助理教授两年教职挣扎史
easyOCR 字符識別
How to introduce devsecops into enterprises?
P6183 [USACO10MAR] The Rock Game S
lv_ font_ Conv offline conversion
lvgl 显示图片示例
Coding devsecops helps financial enterprises run out of digital acceleration
Bugku's Ah Da
Common redis data types and application scenarios
Definition of episodic and batch
Common MySQL interview questions (1) (written MySQL interview questions)
Cartoon: programmers don't repair computers!
P1451 求细胞数量/1329:【例8.2】细胞
机器学习框架简述
Ten billion massage machine blue ocean, difficult to be a giant
Machine learning notes - gray wolf optimization
Bugku easy_ nbt