Jump to content
  • Advertisement

Archived

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

Shannon Barber

auto keyword

This topic is 6003 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Advertisement
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
You don''t need it anymore : unqualified variables are assumed auto by most if not all ''modern'' compilers.

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

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!