PDF

Introduction of Storage class

Leave a Comment
In C there are four types of storage class.
they are 


1. auto

2. register

3. static

4. extern


Storage class is modifier or qualifier of data types which decides :

1. In which area of memory a particular variable will be stored?
2. What is scope of variable?
3. What is visibility of variable?



Visibility of a variable in C:


Visibility means accessibility. Up to which part or area of a program, we can access a variable, that area of part is known as visibility of that variable.


Scope of a variable in C :


Meaning of scope is to check either variable is alive or dead. Alive means data of a variable has not destroyed from memory. Up to which part or area of the program a variable is alive, that area or part is known as scope of a variable.

In the above figure scope of variable a represented outer red box i.e. it is dead then variable must not be visible.


There are four type of scope in C :



1. Block scope

2. function scope

3. File scope

4. Program scope


This will be clear when all the topics are covered.

0 comments:

Post a Comment