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

  1. Path: sparky!uunet!ferkel.ucsb.edu!taco!rock!stanford.edu!agate!doc.ic.ac.uk!uknet!acorn!ixi!clive
  2. From: clive@x.co.uk (Clive Feather)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: & of array - what does ANSI specify for resulting value?
  5. Message-ID: <1992Nov18.084637.21112@x.co.uk>
  6. Date: 18 Nov 92 08:46:37 GMT
  7. References: <1992Nov12.174305.1901@ils.nwu.edu> <1992Nov13.204451.26101@eagercon.com>
  8. Organization: IXI Limited, Cambridge, UK
  9. Lines: 31
  10.  
  11. In article <1992Nov13.204451.26101@eagercon.com> eager@eagercon.com writes:
  12. >In article 1901@ils.nwu.edu, engber@ils.nwu.edu (Mike Engber) writes:
  13. >> int foo[3];
  14. >> I know ANSI specifies the type of &foo will be an int**, how about
  15. >> the value? Is it unspecified - or - &foo[0].
  16. > No, ANSI specifies that &foo is illegal.
  17.  
  18. No, ANSI specifies that &foo is perfectly legal. It has type "int (*)[3]"
  19. (pointer to array of 3 ints).
  20.  
  21. > foo is converted to a value which is the address of the first element of
  22. > the array.
  23.  
  24. Not in this context, it isn't.
  25.  
  26. > Some compilers will give you a warning and interpret &foo as foo.  
  27.  
  28. Some old compilers will. Some old compilers will give an error. All
  29. ANSI/ISO compilers will accept this.
  30.  
  31. [Flame on]
  32. *Please* stop posting erroneous information about the ANSI/ISO standard
  33. in this group - I think this is about the third time you've done this
  34. recently - until you've checked it.
  35. [Flame off]
  36.  
  37. -- 
  38. Clive D.W. Feather     | IXI Limited         | If you lie to the compiler,
  39. clive@x.co.uk          | Vision Park         | it will get its revenge.
  40. Phone: +44 223 236 555 | Cambridge   CB4 4RZ |   - Henry Spencer
  41. Fax:   +44 223 236 550 | United Kingdom      |
  42.