[src]
#include< iostream.h >
void main()
{
int **a,m,n; // double pointer for 2d arry
cout<<" n enter the number of rows and coloums for matrix:";
cin>>m>>n;
a=new int *[m]; // dynamic allocation of pointers array for column
for(int i=0;i<m;i++)
a=new int [n]; // dynamic allocation of coloums for each rows
cout<<"n enter the elements:";
for(i=0;i<m;i++)
for(int j=0;j<n;j++)
cin>>a[j];
cout<<"n the elements r:";
for(i=0;i<m;i++)
{
for(int j=0;j<n;j++)
cout<<a[j]<<" ";
cout<<"n";
}
}
[/src]