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=0.2 required=5.0 tests=BAYES_00,INVALID_MSGID, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,bd45e29f9dafca87 X-Google-Attributes: gid103376,public From: Jeff Carter Subject: Re: bitwise comparators Date: 2000/01/19 Message-ID: <3885EAA7.FAF93A78@earthlink.net>#1/1 X-Deja-AN: 574795639 Content-Transfer-Encoding: 7bit References: <3880D375.7E363123@hotmail.com> <38829638.0@news.pacifier.com> <3882FC1C.2BA8C959@hotmail.com> <85vmn2$ki1$1@nnrp1.deja.com> <38836CF2.AB738B8B@hotmail.com> <3883A414.8559E641@earthlink.net> X-Accept-Language: en Content-Type: text/plain; charset=us-ascii X-ELN-Date: Wed Jan 19 10:48:11 2000 X-Complaints-To: abuse@earthlink.net X-Trace: newsread2.prod.itd.earthlink.net 948307691 38.29.66.219 (Wed, 19 Jan 2000 10:48:11 PST) Organization: EarthLink Network, Inc. MIME-Version: 1.0 Reply-To: jrcarter@acm.org NNTP-Posting-Date: Wed, 19 Jan 2000 10:48:11 PST Newsgroups: comp.lang.ada Date: 2000-01-19T00:00:00+00:00 List-Id: Keith Thompson wrote: > > Jeff Carter writes: > [...] > > C does not have arrays; it only has different notations for address > > arithmetic. > > That's a slight exaggeration. C does have array types and array > objects. For example this: > int a[10]; > declares a as an array of 10 ints, very much like Ada's > A: array(0 .. 9) of Integer; > It does not, contrary to popular misconception, declare a as a > pointer. That would explain why a[0] and *a are different notations for the same thing, and a[2], *(a+2), and 2[a] are also different notations for the same thing. a[2] is defined as a shortcut for *(a+2), which is why 2[a] works. The "array" notation in C is a different notation for address arithmetic. I stand by my statement. Meanwhile, in Ada, A (0) and A (2) are legal, but A.all, 2 (A), and (A + 2).all give compiler errors. > Welcome to the last year of the 20th century. You've got that right. -- Jeff Carter "I fart in your general direction." Monty Python & the Holy Grail