Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site watnot.UUCP Path: utzoo!watmath!watnot!djfiander From: djfiander@watnot.UUCP (David J. Fiander) Newsgroups: net.lang.c Subject: Re: C'mon, guys! Message-ID: <11798@watnot.UUCP> Date: Fri, 6-Jun-86 14:33:17 EDT Article-I.D.: watnot.11798 Posted: Fri Jun 6 14:33:17 1986 Date-Received: Sat, 7-Jun-86 06:37:32 EDT References: <200@pyuxv.UUCP> <1181@ncoast.UUCP> <350@dg_rtp.UUCP> Reply-To: djfiander@watnot.UUCP (David J. Fiander) Organization: U of Waterloo, Ontario Lines: 26 Summary: >> So an array is not a pointer but a reference to an array >> in an expression is a pointer. > >That's part of it, but I strongly suspect that people have been confused by >the fact that when you use an array name in an expression it really means a >pointer to the first member of the array; they interpret this limited >interchangability as meaning pointers and arrays are equivalent. I discovered a very simple way to thing of the name of an array: think of it a a constant. That's how the compiler treats it at least, and that is why the expression: { int a[10], *ptr; ptr = &a; } is invalid, you can't take the address of a macro (which the name of the array is to the compiler. -- UUCP : {allegra,ihnp4,decvax,utzoo,clyde}!watmath!watnot!djfiander CSNET : djfiander%watnot@waterloo.CSNET ARPA : djfiander%watnot%waterloo.csnet@csnet-relay.ARPA BITNET: djfiande@watdcs