Skip to main content

Recent Posts

Web Technology

Storage Class in C

Storage class is a concept In C which provides information about the variable's visibility ,lifetime and scope.

Storage class tells about the following things of variable.
i) Scope of variable
ii) Initial value of variable
iii) Storage location of variable
iv) Life span of variable

Types of storage class:-

i) Automatic variables
ii) External variables
iii) Static variable
iv)  Register variable

Different types of storage class are explained in the table given below:-


Properties/Types
Auto
Register
Extern
Static
storage
Memory
CPU register
Memory
Memory
Default initial value
Garbage value
Garbage Value
0(zero)
0(zero)


scope
Only within the block it is defined 
Only to the block it is defined
Within whole program
Only within the block it is defined


Life
Till control remains within block in which variable is defined
Same as auto
As long as program executes
Persist between different function call 

Click Here to download complete Notes of C programming


Comments