In my main I have this:
vector<vector<u8>> matrix(size.first, vector<u8>(size.second));
for(auto i = 0; i < matrix.size(); ++i){
for(auto j = 0; j < matrix[0].size(); ++j){
matrix[i][j] = 5;
}
}
print_matrix(matrix);
The function print_matrix is:
void print_matrix(vector<vector<u8>>& m){
cout << "_______________________\n";
for(size_t i (0) ; i < m.size(); ++i){
auto& row = m[i];
for(size_t j (0); j < row.size(); ++j){
cout << row[j] << "-";
}
cout << endl;
}
}
I was expecting to get a matrix full of 5 printed on the stdout, but instead I get:
_______________________
-----
-----
-----
-----
-----
Why there are no numbers printed in the output?