c++ - Error: does not name a type (using auto) -


i studying auto c++ primer 5th edition. gave me examples such as:

auto item = val1 + val2; 

from understand auto tells type forms expression make. did own:

int test1 = 69, test2 = 72; auto test3 = test1 + test2; 

but got error: " 'test3' not name type"

what mean? though test3 become same type test1,test2 int.

i run example without --std=c++11, fails same error message.

try configure codeblocks again this suggests.

or can run code hand g++ --std=c++11 code.cc.

to see if c++11 enabled, can type more c++11 code, declaring nested vector vector<vector<int>> vv; see if deals >> well.


  1. how can add c++11 support code::blocks compiler?

Popular posts from this blog

php - How should I create my API for mobile applications (Needs Authentication) -

5 Reasons to Blog Anonymously (and 5 Reasons Not To)

Google AdWords and AdSense - A Dynamic Small Business Marketing Duo