C Programming Reference >> C Basic Tutorials >> C Keywords Home >> autoui 30/12/06 - Views - Ratings : As you have learned there mainly two variables local or global depending upon on thier scope or lifetime withrespect to function. Local variables are the variables declared within the function. Earlier to mark local variables keyword 'auto' was used. Now all compilers by default assume all variables declare within the function as local unless specified. So this keyword is now obsolete and virtually never used. Since it has been not used for decades its a possibility that modern compilers does not support it. Hence its highly recommended you make use of this keyword so that your code can be compiled by legacy of compilers. Code - void function (void)
{
auto int a = 10;
auto int b;
b = a;
}
|