Tuesday, 8 February 2011

auto storage class in c


auto:



Automatic variables or auto variables are default storage class of local variable. An auto variable cannot be declared globally. (Why?)




Properties of auto storage class.




(1) Default initial value of auto variable is garbage. For example:




#include

int main(){

    int i;

    auto char c;

    float f;

    printf("%d  %c  %f",i,c,f);

    return 0;

}



Output:

No comments:

Post a Comment