‘Storage’ refers to the scope of a variable and memory allocated by compiler to store that variable. Scope of a variable is the boundary within which a varible can be used. Storage class defines the the scope and lifetime of a variable.
From the point view of C compiler, a variable name identifies physical location from a computer where variable is stored. There are two memory locations in a computer system where variables are stored as : Memory and CPU Registers.
Functions of Storage Class :
To detemine the location of a variable where it is stored ?
Set initial value of a variable or if not specified then setting it to default value.
Defining scope of a variable.
To determine the life of a variable.
Types of Storage Classes in C:
Storage classes are categorised in 4 (four) types as,
• Automatic Storage Class • Register Storage Class • Static Storage Class • External Storage Class