Go4Expert

Go4Expert (http://www.go4expert.com/)
-   C (http://www.go4expert.com/forums/c/)
-   -   program for accessing a array using pointer (http://www.go4expert.com/forums/program-accessing-array-using-pointer-t7900/)

bashamsc 18Dec2007 10:12

program for accessing a array using pointer
 
Code: C

#include<iostream.h>
main()
{
int* a;int arr[2][3];

arr[0][0]=1;
arr[0][1]=2;
arr[0][2]=3;
arr[1][0]=4;
arr[1][1]=5;
arr[1][2]=6;

a = &arr[0][0];


int i,j;

for(i=0;i<2;i++)
{
for(j=0;j<3;j++)
{
cout<<*(a+j)<<endl;
}
a=a+3;
}
}


shabbir 18Dec2007 17:54

Re: program for accessing a array using pointer
 
Instead of using the color block around the code use the code block.

Salem 18Dec2007 19:35

Re: program for accessing a array using pointer
 
Was there a question in there?
It's just code, no explanation, no questions, nothing, nada, zip, zilch.


All times are GMT +5.5. The time now is 13:38.