Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • Automatic Storage Class in C language

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 104
    Comment on it

     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)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: