Node:Other storage classes, Previous:Static variables, Up:Storage classes
Other storage classes
There are three more storage class identifiers in C: auto
,
register
, and typedef
.
auto
is the opposite ofstatic
. It is redundant, but is included in contemporary versions of C for backwards compatibility. All local variables areauto
by default.register
is another outdated C storage class. Defining a variable asregister
used to store it in one of the computer's registers, a specific location on its processor chip, thereby making code using that variable run faster. These days, most C compilers (including GCC) are smart enough to optimize the code (make it faster and more compact) without theregister
keyword.typedef
allows you to define your own variable types. See More data types, for more information.