Re: Query: Declaring arrays as extern
subin gangadharan <[email protected]> Fri, 23 Dec 2011 10:38:29 -0600
| Newsgroups | org.kernel.vger.linux-c-programming |
|---|---|
| Message-ID | <CAKRO8z+-CBpY_bS24UTCFNheOp_QM3fmYPtf_+h=u-xhKeUQcQ@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 <[email protected]> wrote: > On Thu, Dec 22, 2011 at 2:34 PM, viresh kumar <[email protected]> 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 [email protected] > 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 [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html