Defining storage classes
C provides a number of storage classes. These fall into the following two general categories:
- Fixed storage allocation: Fixed storage allocation means that memory is allocated in the location where it is declared. All fixed storage is named; we have called these variables identifiers, or just variables. Fixed storage includes both the automatic storage class and the static storage class. We have been using automatic storage for every variable thus far. When you declare a variable and—optionally—initialize it, you are using automatic storage. We will introduce static storage later in this chapter.
- Dynamic storage allocation: Dynamic storage allocation means that memory is allocated upon demand and is only referenced via a pointer. The pointer may be a fixed, named pointer variable, or it may be a part of another dynamic structure.
Two properties of storage classes are their visibility—or scope—within a program...