I'm tryig to perform some matrix calculations with ++, but i want to define the matrix and it's dimensions as an array within the program using dynamic memory, rather than explicitly at the beginning of the program.
it seems to work in the sense that it counts the refernce to elements of the matrix correctly, but when i test i cannot retrieve the values from the array.
cout << "How many Matrices do you want to manipulate? ";
cin >> i;
Matrix = new (nothrow) int[i];
{
for (x=1; x<i+1; x++)
{
cout << "\n For Matrix " << x << " please enter the dimensions \n";
cout << "\n N is: ";
cin >> n;
cout << "\n M is: ";
cin >> m;
int Matrix[x] [n][m];
for (a = 0; a < n ; a++)
{
for (b = 0; b < m ; b++)
{
cout << "\n Enter value Matrix " << x << " reference [" << a << b <<"] ";
cin >> Matrix[x] [a];
}
}
}