Koenig on pointers and arrays
Woodrow Baker
woody at rpp386.cactus.org
Sun Jan 21 15:45:48 AEST 1990
In article <10347 at alice.UUCP>, ark at alice.UUCP (Andrew Koenig) writes:
>
> initial (0th) element of `a'. Thus the call
>
> f(a);
>
> is precisely equivalent to the call
>
> f(&(a[0]));
>
> in which it is perhaps more readily visible that what is being passed
> is actually the address of an element.
I find that the above construct is the most easily understandable version.
I use an old old 'C' compiler, lattice 2.0 for the PC, at work. For
historical reasons, It is not an easy task to maintain the several megs
of code that it is my job to maintain and enhance, with any other compiler.
Prior coders used compiler dependencies rather heavily. I have *believe it
or not * had problems just refering to an array with this compiler and
haveing it give me the address. In self defense, I have adopted &(array[0])
as my convention. It does tend to show what the meaning is.
Cheers
Woody
More information about the Comp.lang.c
mailing list