I'm a beginner in C++.
I'm trying to make a Matrix class by my own to train me.
I declared in my class Matrix
std::vector<std::vector<long>> m_data;
whitch is a 2D vector to store my numbers. In a constructor I want to initialize my 2D array with 2 arguments : NbRows
and NbCols
. I'm stuck there.
Matrix::Matrix(unsigned int nb_row, unsigned int nb_col)
{
int i, j;
m_nbRow = nb_row;
m_nbCol = nb_col;
for(i = 0; i < m_nbCol; i ++)
{
for(j = 0; j <m_nbRow; j ++)
{
// ?????
}
}
}