gdb and g77

craig@jcb-sc.com craig@jcb-sc.com
Mon Jun 14 16:22:00 GMT 1999


>> (Yes, it is a "C-ish" back end, but it does have a higher-level array
>> facility than C itself does, insofar that C cannot represent arrays
>> of arrays -- instead, it represents arrays of pointers to arrays, for
>> example.)
>
>Huh?  C can represent arrays of arrays just fine.

That's news to me.  Care to show how?  Note I said *represent* -- not
*implement* -- as any language that provides single-dimensional arrays
can be used to *implement* multi-dimensional arrays.

So, basically, what I'm asking is, what is the C notation that denotes
the equivalent to Fortran's

  REAL A(5,6)

(except that it's row-major, of course) *including* the fact that the
storage takes up 30 units of memory *and* the fact that the same array
declaration works just fine regardless of whether A is a local variable,
in common (external) storage, or a dummy argument (the last case being
especially notable)?

Reason I ask is, in the past, C programmers have occasionally taken
to comp.lang.fortran showing how "easy" it is to cons up a set of
preprocessor macros to make C *look* like it has multi-dimensional arrays
a la Fortran.  I'm sure they'd be quite surprised to learn that C
had them all along!

        tq vm, (burley)


More information about the Gcc mailing list