The ones who are crazy enough to think they can change the world are the ones who do.- Steve Jobs
auto int m1;
#include <stdio.h>
int main()
{
//declaration of automatic variables within main function
auto int m1 = 5; //declaration of automatic variable with the keyword auto
int m2 = 10; //declaration of automatic variable without the keyword auto
printf("The value of m1 : %d ", m1);
printf("\nThe value of m2 : %d ", m2);
return 0;
}
The automatic variables are declared and initialized inside the main function.
| Keyword | auto |
| Storage Type | Memory |
| Scope | Block Scope |
| Life Time | Static life time |
| Visibility | Local/Global |
| Default Value | Garbage value |
| Default Storage Class | Yes |
We may make mistakes(spelling, program bug, typing mistake and etc.), So we have this container to collect mistakes. We highly respect your findings.
© Copyright 2019