Path: utzoo!attcan!uunet!aplcen!uakari.primate.wisc.edu!zaphod.mps.ohio-state.edu!excelan!unix!hplabs!hpda!hpcuhb!hpcllla!hpclisp!hpclwjm!walter From: walter@hpclwjm.HP.COM (Walter Murray) Newsgroups: comp.lang.c Subject: Re: Re: "array" vs. "&array" ? (not again! :-O ) Message-ID: <660070@hpclwjm.HP.COM> Date: 11 Jan 90 17:48:20 GMT References: <571@mwtech.UUCP> Organization: Hewlett-Packard Calif. Language Lab Lines: 28 Gary L. Randolph writes: > If this part of the answer does not seem reasonable, take it up with > Harbison and Steele's second edition. The statement was taken verbatim > from page 273, section 11.6.4. [Quoting H&S-2: "The address operator & applied to an array yields "pointer to array of T" or "pointer to pointer to T".] This statement by Harbison and Steele contradicts ANSI C. They should not have added the part about "pointer to pointer to T". ANSI 3.3.3.2. > And, if that is not enough, see page 200 A7.1 of K&R2 (or read below). > If the type of an expression or subexpression is "array of T," for > some type T, then the value of the expression is a pointer to the > first object in the array, and the type of the expression is altered > to "pointer to T". > K&R2 does not say that the above is true only for a few special cases. Read the very next sentence: "This conversion does not take place if the expression is the operand of the unary & operator ... ." This is in ANSI 3.2.2.1. Walter Murray ----------