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 19:13:02 -0700 Organization: None to speak of Lines: 76 Message-ID: References: <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="2948"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/GvjSqDQ0Wjb8/7OkT3WVe" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) Cancel-Lock: sha1:7GCmqHENz/WVwUCaCTZyfHR4gEE= sha1:zZ9nRapAGTRcVqQ4YVRINrxgGlg= Xref: csiph.com comp.lang.c:92328 BartC writes: > On 16/08/2016 01:57, Keith Thompson wrote: >> BartC writes: > >>> If I said that arrays and pointers in C are the same, then perhaps that >>> wasn't exactly right, >> >> Then we've made some progress ... >> >>> but within the context of that example, then yes >>> they were were treated interchangeably. >> >> ... but not much. >> >> Please stop moving the goalposts. > > Nevertheless that's what you first picked up on. That was the title of > the section where I demonstrated that C DOESN'T CARE whether a term is > an array or not. That is just incredibly sloppy. > > If the language lets me write: > > *A // when A is an array > > and: > > p[i] // when p is a pointer (forgetting i[p]...) > > then there is nothing more to say. While these are easy to spot, only > slightly more elaborate examples can lead to hard-to-detect bugs that > the language is not going to help with. > > No amount of understanding is going to make that behaviour acceptable to > me. Well I'm afraid that's just too bad. Again, this isn't about whether you *accept* it or not. I am offering to help you *understand* it. You currently do not (and, please correct me if I'm mistaken, you seem oddly proud of that). Imagine that I'm teaching you how to use a computer keyboard. We start with the basics: when you press a letter key, that letter appears on the display. Type 'a', and an 'a' appears. What you've been doing is the equivalent of interrupting the lesson to point out that if you type 'a' while holding down the Control key, something else happens, and the keyboard obviously doesn't care whether you pressed the 'a' key or not, and you just won't accept it because it's so confusing, and the people who designed that keyboard must have been *insane*! If you would calm down and accept that that's a more advanced topic and that we'll get to it eventually, you might learn something. I'm sorry if that sounds condescending, but I'm not sure how to say what I'm trying to say without sounding that way. If you wish to continue not understanding how C arrays and pointers work, that's your decision. I merely ask that you refrain from passing on your confusion and misunderstandings to others. Realistically, I expect that you'll continue to post incorrect information. I'll continue to correct it, but I will no longer attempt to help you understand. Unless you change your mind and ask me to. > (And you're still eerily posting from one hour in the future!) Yeah, I don't own the computer I'm posting from. I've already let the owner know. (Either that, or I'm a Time Lord.) -- 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"