What does one mean by 'address of the whole array' ?

On Fri, Sep 16, 2011 at 8:11 PM, mohan kumar <mohankumar...@gmail.com>wrote:

> thank to explain to this problem.......
>
>
>
> On Fri, Sep 16, 2011 at 1:40 PM, Yogesh Yadav <medu...@gmail.com> wrote:
>
>> a[]= {1,      2,      3,       4,        5}
>>         a
>>        &a
>>                  a+1
>>                                                       &a+1
>> &a is address of whole array...so &a+1 means next element after array
>> completion.
>>
>> so ptr-1 will point to 5
>>
>> ...
>>
>>
>> On Fri, Sep 16, 2011 at 1:25 PM, Anup Ghatage <ghat...@gmail.com> wrote:
>>
>>> #include<stdio.h>
>>> int main()
>>> {
>>> int a[5]={1,2,3,4,5};
>>> int *ptr=(&a + 1);
>>> printf("%d %d\n",*(a+1),*(ptr-1));
>>> return 0;
>>> }
>>>
>>> Find the output!
>>>
>>> --
>>> You received this message because you are subscribed to the Google Groups
>>> "Algorithm Geeks" group.
>>> To post to this group, send email to algogeeks@googlegroups.com.
>>> To unsubscribe from this group, send email to
>>> algogeeks+unsubscr...@googlegroups.com.
>>> For more options, visit this group at
>>> http://groups.google.com/group/algogeeks?hl=en.
>>>
>>
>>  --
>> You received this message because you are subscribed to the Google Groups
>> "Algorithm Geeks" group.
>> To post to this group, send email to algogeeks@googlegroups.com.
>> To unsubscribe from this group, send email to
>> algogeeks+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/algogeeks?hl=en.
>>
>
>
>
> --
>
>    - *MOHAN KUMAR*
>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>



-- 
Anup Ghatage

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.

Reply via email to