Address of array
Garry Wiegand
garry at batcomputer.TN.CORNELL.EDU
Fri Mar 21 08:47:11 AEST 1986
In a recent article jsdy at hadron.UUCP (Joseph S. D. Yao) wrote:
>... There is no such thing as a pointer to the whole
>array: that is a Pasqualische or Fortranian notion. Pointers, in
>C, only point to atomic or aggregate (structure/union) objects...
Are you sure of this? I sometimes write:
foo (ap) register float (*ap)[4][4]; {... (*ap)[0][0] = 33; ...}
I do this because my compiler (DEC/Vms) ends up making slightly better
use of registers than if I wrote:
foo (array) float array[4][4]; {... array[0][0] = 33; ...}
(and because it's slightly more pleasing to my brain actually to say "pointer-
to-array" if that's what I'm thinking of). Are you saying my syntax is legal
only by the grace of DEC?
garry wiegand
garry%cadif-oak at cu-arpa.cs.cornell.edu
More information about the Comp.lang.c
mailing list