问题:
p69.cc: In function ‘int main()’:
p69.cc:8:10: error: ‘b’ does not name a type
auto b=1;
^
原因及解决办法:
GCC provides experimental support for the 2011 ISO C++ standard. This support can be enabled with the -std=c++11 or -std=gnu++11 compiler options; the former disables GNU extension.
command line:
$ g++ -std=gnu++11 test.cc
$ g++ -std=c++11 test.cc
这两种办法都可以。