Possible Duplicate:
Is there any reason to use the 'auto' keyword in C / C++?
I read that:
int i;
and
auto int i;
are equivalent. If so, what’s the use of auto keyword in C? Is there any special cases when auto is more useful? Or things that cant be achieved without auto??
Auto is just implicit in C, but due to how rarely (read never) it is used in actual code explicitly its meaning has changed in C++11.
Auto just specifies automatic storage, meaning the variable will go away when it goes out of scope.