Storage Class
Storage class is modifier or qualifier of data type. it will decide
- In which area of memory a variable will be stored.
- Scope of the variable.
- visibility/availability of variable.
Memory Section
In which memory area variable will get memory.
Variable Scope
Scope of variable means whether variable is avalible or not avalible for any operation within a boundry.
There are 4 diffrent types of scope
- Block Scope: Area between curly bracket.
- Function Scope: Function scope means function definition area.
- File Scope: File Area
- Program Scope: Whole program.
Variable Visibility
Visiblity of an variable means Accessibility of variable. upto which part or area of a program, we can access a variable.
Types of Storage Class
There are 4 types of storage class in c
- auto
- register
- static
- extern
Scope and Visiblity of storage class
Storage Class | Declearation | Scope | Visibility |
---|---|---|---|
auto | Global Local | Block | Block |
register | Global Local | Block | Block |
static | Global Local | Program | File Block |
extern | Global Local | Program | Program Block |
©2023-2024 rculock.com