Every identifier not only has a data type but also has a storage class. If any storage class is not specified in a declaration statement, the compiler assumes the default storage class depending upon the scope in which the declaration is made.
The storage class of an identifier determines:
- Where the object associated with the identifier would be stored (in the memory or CPU registers)
- What the initial value of the object associated with the identifier would be (if the identifier is not initialized in the declaration statement)
- Whether the object associated with the identifier would have static (global) or automatic (local) lifetime
The storage class specifier is prefixed in a declaration statement declaring an identifier associated with the object
The C language provides the following storage class specifiers:
- auto
- register
- static
- extern
- typedef
Views: 0