#include <vector>
#include <iostream>
int main()
{
using RowType = std::vector<int>; // alias typename
int row {2};
int column {4};
// you could read those from input here
std::vector<RowType> myarray( row, RowType(column) );
for ( auto& row : myarray ) {
for ( auto elem : row ) {
std::cout << elem << ' ';
}
std::cout << '\n';
}
}
There are low level dynamic memory management options too and most courses go through them, but in practice you should learn and prefer the C++ Standard Library.