home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!ferkel.ucsb.edu!taco!rock!stanford.edu!agate!doc.ic.ac.uk!uknet!acorn!ixi!clive
- From: clive@x.co.uk (Clive Feather)
- Newsgroups: comp.lang.c
- Subject: Re: & of array - what does ANSI specify for resulting value?
- Message-ID: <1992Nov18.084637.21112@x.co.uk>
- Date: 18 Nov 92 08:46:37 GMT
- References: <1992Nov12.174305.1901@ils.nwu.edu> <1992Nov13.204451.26101@eagercon.com>
- Organization: IXI Limited, Cambridge, UK
- Lines: 31
-
- In article <1992Nov13.204451.26101@eagercon.com> eager@eagercon.com writes:
- >In article 1901@ils.nwu.edu, engber@ils.nwu.edu (Mike Engber) writes:
- >> 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].
- > No, ANSI specifies that &foo is illegal.
-
- No, ANSI specifies that &foo is perfectly legal. It has type "int (*)[3]"
- (pointer to array of 3 ints).
-
- > foo is converted to a value which is the address of the first element of
- > the array.
-
- Not in this context, it isn't.
-
- > Some compilers will give you a warning and interpret &foo as foo.
-
- Some old compilers will. Some old compilers will give an error. All
- ANSI/ISO compilers will accept this.
-
- [Flame on]
- *Please* stop posting erroneous information about the ANSI/ISO standard
- in this group - I think this is about the third time you've done this
- recently - until you've checked it.
- [Flame off]
-
- --
- Clive D.W. Feather | IXI Limited | If you lie to the compiler,
- clive@x.co.uk | Vision Park | it will get its revenge.
- Phone: +44 223 236 555 | Cambridge CB4 4RZ | - Henry Spencer
- Fax: +44 223 236 550 | United Kingdom |
-