From mboxrd@z Thu Jan 1 00:00:00 1970 Message-Id: <200107091146.MAA27082@cthulhu.dircon.co.uk> Subject: Re: [9fans] thread In-Reply-To: <3B491B74.607DAB8D@null.net> from "Douglas A. Gwyn" at "Jul 9, 2001 08:33:03 am" To: 9fans@cse.psu.edu From: Digby Tarvin MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Date: Mon, 9 Jul 2001 12:46:04 +0100 Topicbox-Message-UUID: c3ad2f42-eac9-11e9-9e20-41e7f4b1d025 I think you misunderstand. I was referring to the application of '&' to a variable of array type, not to a type. Applied to an array type, it produces a change of type but no change in value. An unusual case where the '&' operator could be replaced by a cast with no change in semantics. I would say that was special treatment, (resulting from the special treatments of array names) albeit in accordance with the C standard. Regards, DigbyT Douglas A. Gwyn: > Digby Tarvin wrote: > > I was aware that the array type was special in that the application of > > the '&' operator to it resulted in a change of type but not of value. > > ? One cannot (meaningfully) apply & to a type, only to a certain kind > of expression. When that expression consists of an identifier that > has been declared as an object having array type, then in fact > &that_identifier is *not* treated specially, according to the C > standard, but rather follows the generic rules for the & operator. > What is special is the special rule that the unadorned identifier > decays, in most contexts, into a pointer to the first element of the > array designated by that identifier; this is closely connected with > arrays not being first-class objects in C. It is often convenient, > but is not natural. > -- Digby R. S. Tarvin digbyt@acm.org http://www.cthulhu.dircon.co.uk