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);
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());
All the buzzt!
CornedBee
"There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
- Flon's Law