Answers for "how to push element in vector in c++"

C++
3

how to append to a vector c++

//vector.push_back is the function. For example, if we want to add
//3 to a vector, it is just vector.push_back(3)
vector <int> vi;
vi.push_back(1); //[1]
vi.push_back(2); //[1,2]
Posted by: Guest on April-13-2020

Code answers related to "how to push element in vector in c++"

Browse Popular Code Answers by Language