Connect with us

automatic storage classes

Discussion in 'Microcontrollers, Programming and IoT' started by champ1, Oct 20, 2019.

  1. champ1

    champ1

    32
    0
    Jul 17, 2018
    Hi all

    I am trying to understand the proper use of storage class in c programming

    we can specify a storage class while declaring a variable

    Code:
    Storage_class Data_type Variable_name ;
    For a example,

    Code:
    #include<stdio.h>
    
    void loop (void)
    {
         int count;
        for (count = 0; count <= 10; count++)
        {
            printf("Number :  %d \n", count);
        }
    }
    int main(void)
    {    
        loop();
    
        return 0;
    }
    Suppose I have written auto int count; in the above code

    I don't see any difference at output of program It gives same output as its giving without auto
     
  2. Nanren888

    Nanren888

    121
    25
    Nov 8, 2015
  3. champ1

    champ1

    32
    0
    Jul 17, 2018
    I have been searched but I have confusen I don't know what happen when we write bellow line in the the code
    Code:
    auto int count;
    
    
    what it tells to compiler to do ?
     
  4. Harald Kapp

    Harald Kapp Moderator Moderator

    9,376
    1,907
    Nov 17, 2011
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Electronics Point Logo
Continue to site
Quote of the day

-