Does anyone ever use the auto keyword; and if so, when?
Miki
Printable View
Does anyone ever use the auto keyword; and if so, when?
Miki
No.
The auto keyword is pretty much only used by compiler writers and very anal programmers (even more anal than me). Since all local variables have auto by default there's no need to specify it, it's akin to:
void function ( void );
and
extern void function ( void );
They're both the same because extern is assumed by default so using the extern keyword explicitly isn't required. The reason auto is even there at all is to aid the compiler writers in their job, the auto keyword makes it easier to specify which variables are local and automatic in a compiler's lookup table.
-Prelude