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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,2078dddcdcd8d83 X-Google-Attributes: gid103376,public From: dewar@merv.cs.nyu.edu (Robert Dewar) Subject: Re: Warning: Religious naming convention discussion :-) [was: assign help!!] Date: 1997/05/14 Message-ID: #1/1 X-Deja-AN: 241480219 References: <5kjvcv$evt@news.cis.nctu.edu.tw> Organization: New York University Newsgroups: comp.lang.ada Date: 1997-05-14T00:00:00+00:00 List-Id: David Brown said <> Robert replies Actually this is not nearly so "bad" as you might think, as I pointed out in an earlier reply. A pointer in C is a structured value with two parts A reference to the base (in this case the array foo), and an offset in storage units. Pointer arithmetic adjusts the storage unit offset to correspond to the appropriate number of typed components (i.e. in Ada terms component_size is equal to the type'size, and the offset is adjsuted by bar * component_size. So really one could say that *(foo + bar) is simply a shorthand for foo[bar] rather than the other way round!