home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c
- Path: sparky!uunet!ukma!usenet.ins.cwru.edu!agate!stanford.edu!leland.Stanford.EDU!dkeisen
- From: dkeisen@leland.Stanford.EDU (Dave Eisen)
- Subject: Re: & of array - what does ANSI specify for resulting value?
- Message-ID: <1992Nov12.211918.8502@leland.Stanford.EDU>
- Sender: news@leland.Stanford.EDU (Mr News)
- Organization: Sequoia Peripherals, Inc.
- References: <1992Nov12.174305.1901@ils.nwu.edu>
- Date: Thu, 12 Nov 92 21:19:18 GMT
- Lines: 27
-
- In article <1992Nov12.174305.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 doesn't specify this.
-
- foo is an array of the ints (int [3]), so its address is a pointer
- to that type, a pointer to an int of 3 arrays (int (*)[3]), not
- an (int **) which is a pointer to a pointer to an int. Array names
- are converted to a pointer to their first element when used in an
- expression; they are not converted when used as the operand of sizeof
- or &.
-
- I really don't understand what you mean by its value. &foo is clearly
- a pointer which points to foo. This is, after all, the definition of
- the "&" operator. But I'm sure you knew that. So what are you driving at?
-
-
-
- --
- Dave Eisen Sequoia Peripherals: (415) 967-5644
- dkeisen@leland.Stanford.EDU Home: (415) 321-5154
- There's something in my library to offend everybody.
- --- Washington Coalition Against Censorship
-