Storage Classes in C language defines the Scope of the Variable in the Entire program.
There are 4 Storage Classes in C language :
-By default , for every local variable auto class is selected.
auto int var;
Above both way is correct to define a auto variable.
-By using this class, variable can store in directly in register instead of the RAM.
register type variable;
register int a;
register float b;
register char c;
- By using this class, the existance of the local variable is become the life time of the program.
static type variable
-By using this class, the scope of the variable is become widely. means we can excess this variable from anywhere in the entire program.
auto int a=1;
static int b=2;
register int c=3;
extern int d=4;