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

C++
1

insert vector to end of vector c++

vector<int> a;
vector<int> b;

a.insert(a.end(), b.begin(), b.end());
// or
a.insert(std::end(a), std::begin(b), std::end(b));
Posted by: Guest on February-28-2021
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