Orphaned Response

rs at mirror.UUCP rs at mirror.UUCP
Wed May 29 06:30:00 AEST 1985



Yeah, "an array==pointer" is at the heart of C, sort of.  It is only
true when "array" is being passed or received as a parameter.  In this
case, the C automatically changes all array names (e.g., foo(arr))
into addresses of the first element (e.g., foo(&arr[0])).

Why?  Well, I think history had something to do with it.  The
first versions of C had no structures or longs.  Everything fit on
the stack.  'You say arrays don't fit?  Well then, let's just state
that "array==pointer,"' I can hear the Wizard of New Jersey say,
as they huddled around their pdp7...  I think that B and BCPL (father
and grandfather of C*) didn't really support arrays, just pointers
and memory locations.



More information about the Comp.lang.c mailing list