He’s trying to make a (n)x(m) Matrix (so actually technically x and y could be dropped). The constructor overloads I provided are the fill constructors.
its just initializing a linear vector of ints but it still has the capacity of rows * cols so it can still be accessed in a similar way as a 2d array via the following. At least that would be my best guess.
1 2 3 4 5 6 7 8 9
size_t row = 4; size_t cols = 5;
vector<int> X(row * cols);
for (size_t x = 0; x < row * cols; x++) {
std::cout << X[x];
if(x+1 >= cols && !((x + 1) % cols))// hmmmm . ... math is hard
std::cout << "\n";
}
probably alot easier then dealing with vectors inside of vectors