From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,7b65fc33a05f24b6 X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news1.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!nx02.iad.newshosting.com!newshosting.com!69.16.185.21.MISMATCH!npeer03.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!post02.iad.highwinds-media.com!newsfe03.iad.POSTED!4a71828c!not-for-mail From: Hyman Rosen User-Agent: Thunderbird 2.0.0.18 (Windows/20081105) MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: A curiosity... References: <0f009ce8-0f50-4b85-9368-0d0c68f42da1@w34g2000yqm.googlegroups.com> In-Reply-To: <0f009ce8-0f50-4b85-9368-0d0c68f42da1@w34g2000yqm.googlegroups.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Message-ID: X-Complaints-To: abuse@WWWSpace.NET NNTP-Posting-Date: Thu, 04 Dec 2008 22:19:13 UTC Date: Thu, 04 Dec 2008 17:19:10 -0500 Xref: g2news2.google.com comp.lang.ada:3849 Date: 2008-12-04T17:19:10-05:00 List-Id: Ludovic Brenta wrote: > Yes. In fact, C requires that pointers and integers be interchangable > so as to make address arithmetic "transparent" and extremely > dangerous. That's why, instead of writing "&th[t]" as Adam did, they > wrote "th+t" and thought themselves clever. That's completely false. The expression 'th + t' exhibits two features of C, neither of which involves pointers and integers being interchangeable. The first is that in an expression, a value of type 'array of T' converts to the type 'pointer to T' with value 'address of first element of that array'. The second is that adding integers to pointers is equivalent to indexing; given a pointer to an element of an array, adding or subtracting a number from it results in a pointer pointing to another element of the array.