-
Storage classes are used for two purposes in C:
-
control the visibility of a name
-
specify how storage is allocated for a variable
-
There are 4 storage classes:
- auto
- static
- extern
- register
-
Recall the difference between a declaration and a
definition
-
A declaration states that a name exists and how it can
be used - a procedure declaration gives the name of the
procedure, its return type and optionally the types of its
parameters
-
A declaration only tells the compiler that the procedure
or variable exists, and will be defined elsewhere--the
compiler doesn't create the procedure or variable
-
A definition contains all the information that a
declaration does, plus it creates the procedure or variable
|
|