Storage Class

Storage class is an addition to data type of a variable. It is optional to define. But to give an extra attribute to variable, it is used. As per its different types, it is used for some specific application of a variable.

<storage class keyword>   <data type>   <variable name>;

Types of storage class

1.Automatic
2.Register
3.Static
4.External

Scope

It is the area or location, where we can use or access the variable. A variable can not be accessed outside its scope.

Life

It is the time up to which a variable is alive. Basically it is lifetime, between the creation of a variable and destruction of that variable.

Storage

It specifies the place in the memory where the variable is to be stored. Simply it shows location (not specific address but place) where the variable of written storage class is stored.

Default value

It shows that which default value is given to a variable when no value is given. It is different for each variable type, here type means storage class of it.

Lessons learned from this blog:

1 ) Purpose of using storage class.
2 ) How to use storage class.
3 ) Types of storage class.
4 ) Syntax of using storage classes.
5 ) Conceptual meaning of default value, storage, scope, lifetime.

Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments