0

for this code:

for(auto x=v.begin(); x!=v.end(); x++) cout<<*x<<" "; 

I get the following error:

error: 'x' does not name a type for(auto x=v.begin(); x!=v.end(); x++) 
3
  • 1
    Which compiler do you use? Which plattfom? auto was introduced with C++11 Commented Aug 4, 2020 at 9:18
  • auto in this guise is C++11 onwards. Commented Aug 4, 2020 at 9:19
  • @da-chiller - Not true. The auto keyword has been in every C++ version. It was repurposed in C++11. Commented Aug 4, 2020 at 9:40

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.