Path: csiph.com!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Keith Thompson Newsgroups: comp.lang.c Subject: Re: Difference between these pointer syntaxes Date: Mon, 15 Aug 2016 16:03:53 -0700 Organization: None to speak of Lines: 50 Message-ID: References: <87vaz7eg7c.fsf@bsb.me.uk> <87tweqdeuo.fsf@bsb.me.uk> <87y441a697.fsf@bsb.me.uk> <87r39s8w6c.fsf@bsb.me.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: mx02.eternal-september.org; posting-host="945944de09706c9b4e29b53c9d2efdc2"; logging-data="32395"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19nnhRZLBUwAotSdqDmRIxq" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) Cancel-Lock: sha1:DZQdU9qIH44QfZ35yUocM4XutIQ= sha1:QktASjuZUGHoj+OA56jZ+NstPYw= Xref: csiph.com comp.lang.c:92324 BartC writes: > On 15/08/2016 22:50, Keith Thompson wrote: >> BartC writes: >>> On 15/08/2016 21:32, Keith Thompson wrote: >>>> BartC writes: >>> >>>>> The best I could do would be to take a conventional array/pointer type >>>>> model WHERE THE TWO ARE DISTINCT, >>>> >>>> Arrays and pointer types are distinct. >>> >>> This is where any argument becomes futile. >> >> Ok, let's try this. Do you understand the difference between an >> *array object* and a *pointer object*? Leave aside for now what >> operations you can perform on them, and the semantics of those >> operations. >> >> To make it concrete, consider these two definitions. Let's say >> they're at file scope. >> >> int arr[10]; >> int *ptr; >> >> Considering them *only as objects* (regions of storage able to hold >> values), do you understand what they are and how they're different? > > Yes. But [SNIP] You've said you find this very confusing. Taking you at your word, I'm beginning an attempt to explain it, starting with a simple and straightforward example. If you're going to immediately, after just one word of acknowledgement, into examples designed to confuse the issue, examples we've all seen before, this isn't going to work. Are you interested in learning how arrays work in C or not? If you are, we can continue (and I'll ask you to answer the questions I asked with more than just "Yes"). If not, I'll ask you to stop trying to explain to others things that you don't understand yourself. Which will it be? -- Keith Thompson (The_Other_Keith) kst-u@mib.org Working, but not speaking, for JetHead Development, Inc. "We must do something. This is something. Therefore, we must do this." -- Antony Jay and Jonathan Lynn, "Yes Minister"