Answers for "how to use vector in cpp"

C++
0

c++ vector declaration

vector<int> vec;
//Creates an empty (size 0) vector

vector<int> vec(2);
//Creates a vector with 2 elements.

vector<int> vec(4, 3);
//Creates a vector with 4 elements.
//Each element is initialised to 3.
Posted by: Guest on February-09-2022
3

vectors in c++

vector <int> vc;
Posted by: Guest on March-07-2021

Code answers related to "how to use vector in cpp"

Browse Popular Code Answers by Language