I assume you are trying to declare a two dimension array with the dimensions as inputted from the user
Well, that is what I am trying to do... how can I create this kind of array?
Here is the code:
Code:
#include <iostream.h>
int main()
{
int x, y, x1, y1;
//Asks how many columns and rows the (two dimensioned) array should have
cout<<"Programa que calcula matrizes\n\n";
cout<<"Quantas linhas tem a matriz que quer visualizar? ";
cin>>x;
cout<<"Quantas colunas tem a matriz que quer visualizar? ";
cin>>y;
// Creates a two dimensioned X by Y array
int matriz['x']['y'];
// Fills the array with values given by the user
x1=0;
while (x!=x1)
{
x1++;
y1=0;
while (y!=y1)
{
y1++;
cout<<"\nQuanto vale o termo da linha "<<x1<<" e coluna "<<y1<<"? ";
cin>>matriz['x1']['y1'];
}
}
return 0;
}
And thanks for the help !