im trying to put a vector into another vector using push_back.
but its not happening.
Code:vector<int> a; vector<int> temp;
//...//
temp.push_back(a);
Printable View
im trying to put a vector into another vector using push_back.
but its not happening.
Code:vector<int> a; vector<int> temp;
//...//
temp.push_back(a);
push_back takes a single element, not a whole container.
To append a container to another, use insert:
Code:v1.insert(v1.end(), v2.begin(), v2.end());
sweet. thank you.