home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / lang / c / 16937 < prev    next >
Encoding:
Internet Message Format  |  1992-11-20  |  1004 b 

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