#include <iostream>
usingnamespace std;
int main()
{
int m,n,a[m][n],i,j;
cout<<"type the numbers for rows and columns"<<endl;
cin>>m;
cin>>n;
cout<<"type the content of the matrix"<<endl;
for (i=0; i<m; i++)
for (j=0; j<n; j++)
cin>>a[i][j];
for (i=0; i<m; i++)
for (j=0; j<n; j++)
cout<<a[i][j];
return 0;
}
first problem, you are defining a as an array, I'm surprised your compiler isn't yelling at you- if you want to create it dynamically you have to make an int pointer and allocate it with new. In your case m and n aren't even initialized so it wouldn't work even if that was the correct method.
you can use a vector(or deque or other stl container) or dynamic arrays to accomplish your goals. I would recommend a vector.