auto keyword not working in Dev c++

Viewed 9038

This was a code I wrote to see how auto keyword works but it didn't got compiled in Dev C++ and gave the following warning: [Warning] C++11 auto only available with -std=c++11 or -std=gnu++11 How to overcome this glitch and do what the warning tells to do?

#include<iostream>
#include<string>
#include<vector>

using namespace std;
int main()
{
    std::vector<auto> v={2,-1,4,6,7};
    auto beg = v.begin();
    while (beg != v.end())
    {
        ++beg;
        cout<<beg;
    }
}
1 Answers
Related