Hello I have created a 2d-vector I have no problems filing this vector. But the issue I am having is that I want to extract a specific row of this 2D vector (say the 2nd) and store it as a 1d vector. What would be the best way to do this? Can I use the copy command and if so how do I do that?
I probably can use a for loop and loop throw that specific index and push it in a new vector but thats not quite elegant enough. I figured the the copy function should work??
//Create 2d vector
vector< vector<char> > VecGrid;
vector< vector<char> > VecGrid(3, vector<char>(15,'O'));
//Storage Container for row
vector<char> VecRow
copy(VecGrid[3].begin(), VecGrid.end(),VecRow)