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 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,1cf653444208df72 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-10-22 12:14:23 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news.tele.dk!small.news.tele.dk!148.122.208.68!news2.oke.nextra.no!nextra.com!news1.oke.nextra.no.POSTED!not-for-mail Sender: ohk@maestro.clustra.com Newsgroups: comp.lang.ada Subject: Re: ada vs. cpp References: <9pgr68$7pu1@news.cis.okstate.edu> <9phnic$9g5$1@nh.pace.co.uk> <5fkv7.134136$w7.19988807@news02.optonline.net> <9pmpk00a53@drn.newsguy.com> <9puvdc$225$1@nh.pace.co.uk> <9pv2f20jf4@drn.newsguy.com> <3BC3DA0A.267D4302@adaworks.com> <3BC45801.83F0B59@sparc01.ftw.rsc.raytheon.com> <3BD420BE.3A0B1E6F@sparc01.ftw.rsc.raytheon.com> From: Ole-Hjalmar Kristensen Message-ID: User-Agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/20.3 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii NNTP-Posting-Host: 194.143.59.98 X-Complaints-To: news-abuse@nextra.no NNTP-Posting-Date: Mon, 22 Oct 2001 21:14:21 MET DST Organization: Nextra Public Access X-Trace: readme.online.no 1003778062 194.143.59.98 Date: 22 Oct 2001 21:14:21 +0200 Xref: archiver1.google.com comp.lang.ada:15046 Date: 2001-10-22T21:14:21+02:00 List-Id: Wes Groleau writes: > David Thompson wrote: > > There are no implicit conversions between pointer types > > and arithmetic types in (standard) C, nor in C++ for the > > True. But there is pointer [+*-] number, which is > nearly the same thing. > > -- > Wes Groleau > http://freepages.rootsweb.com/~wgroleau Not really. Pointer artihmetic in C is very closely related to array indexing, and just as (un)safe. In fact the following always holds: some_array[i] == *(some_array +i) == i[some_array] Both array expressions are implicitly converted to the pointer arihmetic expression. In fact, the following expression is completely legal, but perhaps strange C: 17[some_array] = x; -- Kabelsalat ist gesund. Ole-Hj. Kristensen