Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

auto Keyword

The auto keyword is a declaration specifier. However, the C++ standard defines an original and a revised meaning for this keyword. Before Visual C++ 2010, the auto keyword declares a variable in the automatic storage class; that is, a variable that has a local lifetime. Starting with Visual C++ 2010, the auto keyword declares a variable whose type is deduced from the initialization expression in its declaration. The /Zc:auto[-] compiler option controls the meaning of the auto keyword.

auto declarator ;
auto declarator initializer;

The definition of the auto keyword changes in the C++ programming language, but not in the C programming language.

The following topics describe the auto keyword and the corresponding compiler option:

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.