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;
    }
}
                You need to enable c++11 in the compiler using the switch instructions can be found here: How to change mode from c++98 mode in Dev-C++ to a mode that supports C++0x (range based for)?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With