- Subject: Re: Query: Declaring arrays as extern
- From: subin gangadharan <subingangadharan@xxxxxxxxx>
- Date: Fri, 23 Dec 2011 10:38:29 -0600
- Cc: linux-c-programming@xxxxxxxxxxxxxxx, Shiraz HASHIM <shiraz.hashim@xxxxxx>, "pratyush.anand" <pratyush.anand@xxxxxx>, "vipin.kumar" <vipin.kumar@xxxxxx>, Viresh KUMAR <viresh.kumar@xxxxxx>, Vipul Kumar SAMAR <vipulkumar.samar@xxxxxx>, bhavna.yadav@xxxxxx, Deepak SIKRI <deepak.sikri@xxxxxx>, Armando VISCONTI <armando.visconti@xxxxxx>, Bhupesh SHARMA <bhupesh.sharma@xxxxxx>, rajeev <rajeev-dlh.kumar@xxxxxx>, Amit VIRDI <Amit.VIRDI@xxxxxx>
- In-reply-to: <CAOh2x=ne21THG6SHrh5RYaryW2Va5JT64BmTvZp9e346rtiM_w@mail.gmail.com>
- List-id: <linux-c-programming.vger.kernel.org>
- References: <CAOh2x=ktZBLD2KDOxdBGtz0Acqc0RDkA-VrCCCO2Nby8D=2FRg@mail.gmail.com> <CAOh2x=ne21THG6SHrh5RYaryW2Va5JT64BmTvZp9e346rtiM_w@mail.gmail.com>
Hi Viresh,
I think this is what's happening in your case.
Imagine array address is 0x1000 and the contents stored are 1,2,3,4...10.
So when you access it as a pointer int *array,address of array will
get 0x1000 and array variable will have the
value 1.So when you print it the value will be 1 and when you
dereference it,it will try to fetch from 0x1.
On Thu, Dec 22, 2011 at 3:04 AM, viresh kumar <viresh.linux@xxxxxxxxx> wrote:
> On Thu, Dec 22, 2011 at 2:34 PM, viresh kumar <viresh.linux@xxxxxxxxx> wrote:
>> Hi,
>>
>> I can observing an behavior which i am not able to explain.
>
> I am
>
> sorry. :)
> --
> To unsubscribe from this list: send the line "unsubscribe linux-c-programming" in
> the body of a message to majordomo@xxxxxxxxxxxxxxx
> More majordomo info at http://vger.kernel.org/majordomo-info.html
--
With Regards
Subin Gangadharan
I am not afraid and I am also not afraid of being afraid.
--
To unsubscribe from this list: send the line "unsubscribe linux-c-programming" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
[Linux Assembler]
[Git]
[Kernel List]
[Fedora Development]
[Fedora Announce]
[Autoconf]
[Yosemite Campsites]
[Yosemite News]
[GCC Help]