auto c++

来源:互联网 发布:思迅软件怎么样 编辑:程序博客网 时间:2024/06/04 19:18

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.


從2010起 auto用在聲明一個變量 由whose type is deduced from the initialization expression in its declaration(在auto聲明變量的初始化語句 ,也就是new語句)

編譯時記得加/Zc:auto[-]

0 0
原创粉丝点击