S
schwarz45
On Sep 30, 1:35 pm, "Maxim S. Shatskih" <[email protected]>
wrote:
snip
Only for a limited meaning of same. Under the conditions in which an
expression of array type is converted to a pointer (what you choose to
call value context), it is true that all three will point to the same
byte in memory. However, the expressions a and &a[0] will be
converted to pointer to T (where T is the type of elemet in a) while
&a will be converted to pointer to array of N T (where N is the number
of elements in the array). These two pointer types are significantly
different and there is no implicit conversion between them.
wrote:
snip
Also note - "a", "&a" and "&a[0]" will all be the same _if placed in the value
context_.
Only for a limited meaning of same. Under the conditions in which an
expression of array type is converted to a pointer (what you choose to
call value context), it is true that all three will point to the same
byte in memory. However, the expressions a and &a[0] will be
converted to pointer to T (where T is the type of elemet in a) while
&a will be converted to pointer to array of N T (where N is the number
of elements in the array). These two pointer types are significantly
different and there is no implicit conversion between them.