C Programming Language

Automatic storage class or variables

                 Automatic variables are allocated space in the variable on the stack. To declare a variable automatic storage class auto specified.

eg:    auto int n;

When you declare a variable, if the omitted variable storage class is automatic.
eg:    int n;

When you declare an automatic variable initialization to be made explicit initial value is undefined.

The scope of an automatic variable is only for the block, or any block within the block, in which it appears. All variables declared within a function are auto by default. A variable can be defined as automatic by placing the keyword auto at the beginning of the variable declaration.

Example:   auto int a;            

Take a look at the following example:

c programming expert.com - The easy way to lean c |Let's learn in different way| Automatic storage class
register storage class Home External Storage class
c program stats