insert at end of vector c++ code example
Example 1: how to append one vector to another c++
vector<int> a;
vector<int> b;
a.insert(a.end(), b.begin(), b.end());
Example 2: insert vector to end of vector c++
vector<int> a;
vector<int> b;
a.insert(a.end(), b.begin(), b.end());
a.insert(std::end(a), std::begin(b), std::end(b));
Example 3: adding element in vector c++
vector_name.push_back(element_to_be_added);
Example 4: how to append to a vector c++
vector <int> vi;
vi.push_back(1);
vi.push_back(2);