当前位置:网站首页>8、 C scope rules
8、 C scope rules
2022-07-28 14:54:00 【Rock magnon】
List of articles
One 、 introduction
Scope refers to the area where the variable exists , Beyond this area, the variable cannot be accessed , stay C In language , There are three kinds of variable declarations :
- local variable : Variables declared in a function , It is unknowable outside the function
- Global variables : Defined outside the function , It is effective throughout the program cycle , In band function , If local variables and global variables have the same name , Will use local variables
- Formal parameters : The parameters of the function , Equivalent to a local variable in a function
Two 、 initialization
When the authority variable is defined , The system will not initialize it . When global variables are defined , The system will initialize it by default :
| data type | Initialize defaults |
|---|---|
| int | 0 |
| char | ‘\0’ |
| float | 0 |
| double | 0 |
| pointer | NULL |
边栏推荐
猜你喜欢

2022 safety officer-a certificate operation certificate examination question bank simulated examination platform operation

ScottPlot入门教程:获取和显示鼠标处的数值

围绕新市民金融聚焦差异化产品设计、智能技术提效及素养教育

VTK notes - picker picker summary
C# 获取当前路径7种方法

2022 melting welding and thermal cutting examination questions and online simulation examination

Summarize the knowledge points of the ten JVM modules. If you don't believe it, you still don't understand it

Floating point data type in C language (did you learn to waste it)

On July 29, apachecon | apachepulsar's exploration and practice in vivo will be broadcast soon

Many "double first-class" universities have launched the research guarantee and prediction name!
随机推荐
468产品策划与推广方案(150份)
How to use the C language library function getchar ()
Excel VBA password free view VBE encryption code
@DS('slave') 多数据源兼容事务问题解决方案
看了就会的 Rainbond 入门教程
C language program: judging triangles
为自定义属性包装类型添加类 @Published 的能力
如何让照片中的人物笑起来?HMS Core视频编辑服务一键微笑功能,让人物笑容更自然
数字化转型安全问题频发,山石网科助力数字政府建设
Hand in hand from 0 to a "Nuggets special attention" Google plug-in, 5000 words detailed vue3 responsive principle, the advantages, disadvantages and choices of several cache read-write schemes, flyin
OKR与GRAD
QT hex, decimal, qbytearray, qstring data conversion
SwiftUI 4.0 的全新导航系统
QT environment cannot run error set
在 SwiftUI 视图中打开 URL 的若干方法
C language related programming exercises
Hcip day 12
First class exercise
Summarize the knowledge points of the ten JVM modules. If you don't believe it, you still don't understand it
Redis configuration file explanation