home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!munnari.oz.au!goanna!ok
- From: ok@goanna.cs.rmit.oz.au (Richard A. O'Keefe)
- Newsgroups: comp.lang.c
- Subject: Re: & of array - what does ANSI specify for resulting value?
- Message-ID: <16021@goanna.cs.rmit.oz.au>
- Date: 21 Nov 92 06:25:55 GMT
- References: <1992Nov12.174305.1901@ils.nwu.edu> <1992Nov13.204451.26101@eagercon.com>
- Organization: Comp Sci, RMIT, Melbourne, Australia
- Lines: 17
-
- In article 1901@ils.nwu.edu, engber@ils.nwu.edu (Mike Engber) asked:
- ? int foo[3];
- ? I know ANSI specifies the type of &foo will be an int**, how about
- ? the value? Is it unspecified - or - &foo[0].
-
- In article <1992Nov13.204451.26101@eagercon.com>,
- eager@eagercon.com (Michael J. Eager) replied:
- > No, ANSI specifies that &foo is illegal.
-
- Wrong. &foo is legal and has type pointer-to-array-3-of-int.
-
- > foo is converted to a value
- > which is the address of the first element of the array.
-
- Only in a value context. & and sizeof are not value contexts
- and array->pointer decay does not happen.
-
-