Answers for "insert vector to end of another c++"

C++
10

how to append one vector to another c++

vector<int> a;
vector<int> b;
// Appending the integers of b to the end of a 
a.insert(a.end(), b.begin(), b.end());
Posted by: Guest on January-13-2020
0

vector insert to end

std::copy (b.begin(), b.end(), std::back_inserter(a));
Posted by: Guest on July-17-2021

Browse Popular Code Answers by Language