Code:
#include <iostream>
#include <vector>
using namespace std;
int main()
{
vector<int> myvector{ 1, 2, 3, 4, 5 };
for (auto it = myvector.begin();
it != myvector.end(); ++it)
cout << ' ' << *it;
return 0;
}
Everytime I run vector , error message will say... "it must be initialized by constructor, not be'{...}'
And; could not convert '{1, 2, 3, 4, 5, 6}' from '' to std::vector"
What should I do?