Standard C library functions in freestanding systems

S

schwarz45

On Sep 30, 1:35 pm, "Maxim S. Shatskih" <[email protected]>
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,994
Messages
2,570,223
Members
46,810
Latest member
Kassie0918

Latest Threads

Top