Thursday, 19 January 2012

Program Of 2D Array of Pointer In C++


#include<iostream.h>
#include<conio.h>
main()
{
clrscr();
int i,j,a[3][3],*ptr;
for(i=0;i<3;i++)
{
for(j=0;j<3;j++)
{
cout<<"Enter NUmber=";
cin>>a[i][j];
}
}

for(i=0;i<3;i++)
{
for(j=0;j<3;j++)
{
ptr = &a[i][j];
cout<<"\n Value of a["<<i<<"]["<<j<<"]==>"<<a[i][j]<<" And Address of a["<<i<<"]["<<j<<"]==>"<<ptr;
}
cout<<"\n";

}
getch();
}

No comments:

Post a Comment