what is the matter with this program

# include <iostream>
using namespace std;

void readmatrix(int row)
{int column;
cout<<"The Number of Rows=";
cin>>row;
cout<<"The Number of Colums=";
cin>>column;
int matrix1[row][column];

for (int i=0;i<row;i++)
{
for (int j=0;j<column;j++)
{
cin>>matrix1[i][j];
}
}
}

int main ()
{
int row,column;
int matrix[row][column];
readmatrix(matrix[row][column]);

system("pause");
return 0;
}


i want to know why this porgram doesnt run :s
First, you can't create matrices with a variable as the number of rows/columns/etc. You must use new (for C++) or malloc/calloc (for C). Secondly, you never define row and column in main.
You can also use vectors, read http://www.cplusplus.com/forum/articles/7459/
Topic archived. No new replies allowed.