I have been using the following vector initialization with values in Code::Blocks and MingW compiler:
vector v0 {1,2,3,4};
A
You can do nearly that in VS2013
vector v0{ { 1, 2, 3, 4 } };
Full example
#include #include int main() { using namespace std; vector v0{ { 1, 2, 3, 4 } }; for (auto& v : v0){ cout << " " << v; } cout << endl; return 0; }