linux-c-programming.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: subin gangadharan <subingangadharan@gmail.com>
To: viresh kumar <viresh.linux@gmail.com>
Cc: linux-c-programming@vger.kernel.org,
	Shiraz HASHIM <shiraz.hashim@st.com>,
	"pratyush.anand" <pratyush.anand@st.com>,
	"vipin.kumar" <vipin.kumar@st.com>,
	Viresh KUMAR <viresh.kumar@st.com>,
	Vipul Kumar SAMAR <vipulkumar.samar@st.com>,
	bhavna.yadav@st.com, Deepak SIKRI <deepak.sikri@st.com>,
	Armando VISCONTI <armando.visconti@st.com>,
	Bhupesh SHARMA <bhupesh.sharma@st.com>,
	rajeev <rajeev-dlh.kumar@st.com>, Amit VIRDI <Amit.VIRDI@st.com>
Subject: Re: Query: Declaring arrays as extern
Date: Fri, 23 Dec 2011 10:38:29 -0600	[thread overview]
Message-ID: <CAKRO8z+-CBpY_bS24UTCFNheOp_QM3fmYPtf_+h=u-xhKeUQcQ@mail.gmail.com> (raw)
In-Reply-To: <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@gmail.com> wrote:
> On Thu, Dec 22, 2011 at 2:34 PM, viresh kumar <viresh.linux@gmail.com> 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@vger.kernel.org
> 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@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2011-12-23 16:38 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-22  9:04 Query: Declaring arrays as extern viresh kumar
2011-12-22  9:04 ` viresh kumar
2011-12-23 16:38   ` subin gangadharan [this message]
2011-12-23 18:27 ` Alok Singhal

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAKRO8z+-CBpY_bS24UTCFNheOp_QM3fmYPtf_+h=u-xhKeUQcQ@mail.gmail.com' \
    --to=subingangadharan@gmail.com \
    --cc=Amit.VIRDI@st.com \
    --cc=armando.visconti@st.com \
    --cc=bhavna.yadav@st.com \
    --cc=bhupesh.sharma@st.com \
    --cc=deepak.sikri@st.com \
    --cc=linux-c-programming@vger.kernel.org \
    --cc=pratyush.anand@st.com \
    --cc=rajeev-dlh.kumar@st.com \
    --cc=shiraz.hashim@st.com \
    --cc=vipin.kumar@st.com \
    --cc=vipulkumar.samar@st.com \
    --cc=viresh.kumar@st.com \
    --cc=viresh.linux@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).