You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
vector<int> v2(10); // vector of size 10, elements are default initialized to 0
vector<int> v3(10, 42); // 10 elements, all with the values of 42
vector<int> v4{10}; // 1 element with the value of 10
vector<int> v5{10, 42}; // 2 elements: 10 and 42
vector<string> v6{10}; // list initializer can't be used : it doesn't contain strings, compiler makes a vector of strings with a size of 10, each element default initialized to an empty string
vector<string> v7{10, "hi"}; // same as before: creates 10 elements of value "hi"