Storage Classes in C

In C language, each variable has a storage class which is used to define scope and life time of a variable. Storage: Any variable declared in a program can be stored either in memory or registers. Registers are small amount of storage in CPU. The data stored in registers has fast access compared to data stored in memory. Storage class of a variable gives information about the location of the variable in which it is stored, initial value of the variable, if storage class is not specified; scope of the variable; life of the variable.

There are 4 different storage classes are present in C those given as below.
  1. auto
  2. extern
  3. static
  4. register