I want to push_back only one column in a multidimensional vector. How do I only access and push_back the vector at a specific row with an int?
typedef vector<int> Row;
typedef vector<Row> Matrix;
int N = 3;
Matrix restricted(N+1, Row(0));
And then after I run the following "working" code, the table will look like the one below.
restricted[2].push_back(3);
Resultant (array-formatted) vector: {{}, {}, {3}, {}}
restricted[2].push_back(100);
restricted[0].push_back(99);
Resultant (array-formatted) vector: {{99}, {}, {3, 100}, {}}
Resultant error when above code run: no matching function for call to 'std::vector<int>::push_back(<unresolved overloaded function type>)'