Automatic Storage Class used in C for the use of defining the different values by a same name in a program, User will use this value through C language program control method. Auto keyword is used for Automatic Storage Class, when a user declare a variable by using keyword auto, It will stored in Automatic storage class. It should be defined in the Function.
Properties for a Automatic Storage Class:
storage - memory
keyword - auto
lifetime- Till it is defined in the control block
Following are the line of code that will defined the same variable name for defining the different values.
#include<stdio.h>
#include<conio.h>
main()
{
auto int a=5;
{
auto int a=6;
{
auto int a=7;
{
auto int a=8;
printf("%d",a);
}
printf("%d",a);
}
printf("%d",a);
}
printf("%d",a);
getch();
}
0 Comment(s)