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
vector matrix(row, vector(col, 0));
This will initialize a 2D vector of rows=row and columns = col with all initial values as 0. No need to initialize and use resize.
Since the vector is initialized with size, you can use "[]" operator as in array to modify the vector.
matrix[x][y] = 2;