Friday, 24 February 2017

STORAGE CLASSES

STORAGE CLASSES

A storage class defines the scope (visibility) and life-time of variables and/or
functions within a C Program. They precede the type that they modify. We have
four different storage classes in a C program:
· auto
· register
· static
· extern
The auto Storage Class
The auto storage class is the default storage class for all local variables.

{
int mount;
auto int month;
}
The example above defines two variables within the same storage class. ‘auto’
can only be used within functions, i.e., local variables.

No comments:

Post a Comment