Re: Address of an array = address of its 1st element: undecidable question ?
- From: Richard Heathfield <rjh@xxxxxxxxxxxxxxx>
- Date: Fri, 23 May 2008 07:25:51 +0000
CBFalconer said:
Peter Nilsson wrote:
Richard Heathfield <r...@xxxxxxxxxxxxxxx> wrote:... snip ...
If you try to take the value of an array, what you
actually get is the value of a pointer to the first
member of the array. That doesn't mean that an array
is the same as a pointer. If you mean that &array
and &array[0] have the same value, they don't. They
have different types.
What about (void *) &array == (void *) &array[0]?
You should get "syntax error" or equivalent.
Why?
--
Richard Heathfield <http://www.cpax.org.uk>
Email: -http://www. +rjh@
Google users: <http://www.cpax.org.uk/prg/writings/googly.php>
"Usenet is a strange place" - dmr 29 July 1999
.
- Follow-Ups:
- References:
- Address of an array = address of its 1st element: undecidable question ?
- From: candide
- Re: Address of an array = address of its 1st element: undecidable question ?
- From: Richard Heathfield
- Re: Address of an array = address of its 1st element: undecidable question ?
- From: Peter Nilsson
- Re: Address of an array = address of its 1st element: undecidable question ?
- From: CBFalconer
- Address of an array = address of its 1st element: undecidable question ?
- Prev by Date: Re: Once again pointer to first element vs pointer to array cast to pointer to element
- Next by Date: Re: Address of an array = address of its 1st element: undecidable question ?
- Previous by thread: Re: Address of an array = address of its 1st element: undecidable question ?
- Next by thread: Re: Address of an array = address of its 1st element: undecidable question ?
- Index(es):
Relevant Pages
|