Thursday, October 20, 2005

Re: clear the concept of 2D array and pointers

gayathri senthamaraikannan wrote:
> Hi,
> s[0][0] gives the value stored in that array
> &s[0][0] gives the address in which that value is stored
>
> example:
>
> int main()
> {
> int a[2][2]={10,20,
> 30,40};
> printf("\n%d %d",a[0][0],&a[0][0]);
> printf("\n%d %d",a[1][1],&a[1][1]);
> return 0;
> }
>
> Hope this helps
>
> Regards

> Gayathri
>
> On Mon, 17 Oct 2005 raj_abhishek007@rediffmail.com wrote :
> >
> >hi all, i am worry abt the concept of 2D array. Let s[5][2] is a 2D
> >array. so what is the difference between s[0],s[1]..... and &s[0],
> >&s[1].... .pls help me...bye
> >

hi
thanks of my help. but its can not fullfill my requirement. i wanna to
know that &s[0] gives the address of first ROW in 2D array. but if we
implement a programme, the same task is done using s[0] only. it give
the address of first ROW of 2D array also, according to
"LET US C"(book). So my problem is exactly same as well as previous.
bye

0 Comments:

Post a Comment

<< Home