Programming with C

⌘K
  1. Home
  2. Docs
  3. Programming with C
  4. Basics of C Programming
  5. Storage Classes

Storage Classes

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

Articles

How can we help?

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments