Hey guys, I know what the problem is here, but my question is. Is there a way around this, without using a constant too set the size.
1 2 3 4 5 6 7
int max_rows = 0;
int max_cols = 0;
std::cout << "Enter number of rows: ";
std::cin >> max_rows;
std::cout << "\nEnter number of columns: ";
std::cin >> max_cols;
int *numbers = newint[max_rows][max_cols];
You cannot dynamically allocate MD arrays where dimension aside first is not known in compile time. What you can is to allocate array of pointers: int** numbers = newint*[max_rows]; and then allocate array of ints to each pointer:
1 2
for(int i = 0; i < max_rows; ++i)
numbers[i] = newint[max_cols];