C'mon, guys!
Peter S. Shenkin
peters at cubsvax.UUCP
Fri Jun 13 03:51:05 AEST 1986
In article <aimmi.769> gilbert at aimmi.UUCP (Gilbert Cockton) writes:
>Despite reading three years of discussion on and off on the pointer-array
>equivalance topic, as a casual user of C, I've never been able to come
>up with a clear view on when pointers and arrays are equivalent.
>guide to array-pointer equivalences.
> ...
>Any volunteers for a simple set of statements that get the message
>across? There must be many C compiler experts out there.
>
>All I can start with is a straw man, as I'm no expert.
>
>* given an array of dimensions a x b x c .. x n,
> the array name is a pointer to array[0][0][0]..[0]
>
>* the only time this is any real use if when passing arrays by reference
> as `array' is easier and safer to write than
>
> &(array[0][0][0]..[0])
>
> as you don't need to bear the array dimensions in mind.
I'm no expert either, but figured I could submit my own straw man as
more ammunition for the gurus:
When a function is called with an array as its argument, what
is passed is a pointer to the first element of the array.
That's all there is, there ain't no more.
Peter S. Shenkin Columbia Univ. Biology Dept., NY, NY 10027
{philabs,rna}!cubsvax!peters cubsvax!peters at columbia.ARPA
More information about the Comp.lang.c
mailing list