Archived

This topic is now archived and is closed to further replies.

Shannon Barber

auto keyword

Recommended Posts

I haven''t seen any instances where auto was used or have thought of a useful application for it. My guess is that they included it for compatibility with previous versions of C/C++ that didn''t initialize all variables as automatic.

Share this post


Link to post
Share on other sites
I believe there''s a rare situation where a variable declaration can be mistaken for a function prototype or something like that. In the 3rd edition of The C++ Programming Language, Stroustrup makes a reference to a situation where the auto keyword makes a difference, but doesn''t show an example sadly.

Share this post


Link to post
Share on other sites