auto keyword

This is a discussion on auto keyword within the C++ Programming forums, part of the General Programming Boards category; Does anyone ever use the auto keyword; and if so, when? Miki...

  1. #1
    Unregistered
    Guest

    auto keyword

    Does anyone ever use the auto keyword; and if so, when?

    Miki

  2. #2
    S­énior Member
    Join Date
    Jan 2002
    Posts
    982
    No.

  3. #3
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    Posts
    9,796
    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
    My best code is written with the delete key.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Are auto pointers any good?
    By cunnus88 in forum C++ Programming
    Replies: 3
    Last Post: 04-15-2007, 12:07 PM
  2. Virtual Keyword
    By Shal in forum C++ Programming
    Replies: 6
    Last Post: 05-18-2006, 12:37 PM
  3. 'new' keyword
    By pktcperlc++java in forum C++ Programming
    Replies: 4
    Last Post: 02-28-2005, 09:31 PM
  4. Code: An auto expanding array (or how to use gets() safely).
    By anonytmouse in forum Windows Programming
    Replies: 0
    Last Post: 08-10-2004, 01:13 AM
  5. how to search a keyword in C?
    By kreyes in forum C Programming
    Replies: 2
    Last Post: 03-01-2002, 08:22 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21