Understanding internal versus external storage classes
In the storage class of fixed or named memory, C has explicit mechanisms to allocate that memory. These correlate to the following four C keywords:
auto
static
register
extern
Note that the auto
keyword represents the automatic storage class, and the static keyword specifies the static
storage class. We are currently interested in only the first two of these mechanisms. These keywords precede a variable specification, as follows:
<storage class> [const] <data type> <name> [= <initial value>];
In this specification, the following applies:
<storage class>
is one of these four keywords:auto
,static
,register
, andextern
.[const]
is an optional keyword to indicate whether the named memory can be changed after initialization. Ifconst
is present, an initial value must be supplied.<...