I\'m using the vector class in the STL library for the first time. How should I add to a specific row of the vector array?
struct x{
vector
I'm not exactly sure what the problem is, as your example code has several errors and doesn't really make it clear what you're trying to do. But here's how you add to a specific row of a 2D vector:
// declare 2D vector
vector< vector > myVector;
// make new row (arbitrary example)
vector myRow(1,5);
myVector.push_back(myRow);
// add element to row
myVector[0].push_back(1);
Does this answer your question? If not, could you try to be more specific as to what you are having trouble with?