comp.lang.ada
 help / color / mirror / Atom feed
From: kst@thomsoft.com (Keith Thompson)
Subject: Re: Unconstrained array aggregation..sq. peg into round hole?
Date: 1996/03/20
Date: 1996-03-20T00:00:00+00:00	[thread overview]
Message-ID: <DoL6Jv.97t@thomsoft.com> (raw)
In-Reply-To: DoJqI0.51n@world.std.com

In <DoJqI0.51n@world.std.com> bobduff@world.std.com (Robert A Duff) writes:
[...]
> >  In Ada there is a difference between Table(2)(3) and Table(2,3), in
> >C there isn't.
> 
> Right.

Um, not quite.  In C, if Table is declared as a two-dimensional array, then

    Table[2][3]

is a single element of that array.  C's syntax doesn't allow more than
one index expression between a pair of brackets.  The expression

    Table[2,3]

is syntactically legal, but the expression between the brackets includes
a comma operator, so it's equivalent to

    Table[3]

I *think* that gives you a one-dimensional array, the fourth (zero-based
arrays, remember?) row of Table, which in most expression contexts
becomes a pointer to the first element of that row.

-- 
Keith Thompson (The_Other_Keith) kst@thomsoft.com
TeleSoft^H^H^H^H^H^H^H^H Alsys^H^H^H^H^H Thomson Software Products
10251 Vista Sorrento Parkway, Suite 300, San Diego, CA, USA, 92121-2718
This sig uses the word "Exon" in violation of the Communications Decency Act.




  reply	other threads:[~1996-03-20  0:00 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1996-03-17  0:00 Unconstrained array aggregation..sq. peg into round hole? David Weller
1996-03-19  0:00 ` Unconstrained array aggregation..sq. peg i John Hutchison x2141
1996-03-19  0:00 ` Unconstrained array aggregation..sq. peg into round hole? Ted Dennison
1996-03-19  0:00   ` Robert Dewar
1996-03-20  0:00 ` Jon S Anthony
1996-03-20  0:00   ` David Weller
1996-03-20  0:00 ` Robert I. Eachus
1996-03-20  0:00   ` Robert A Duff
1996-03-20  0:00     ` Keith Thompson [this message]
1996-03-21  0:00   ` Robert I. Eachus
1996-03-22  0:00     ` Robert Dewar
1996-03-25  0:00   ` Robert I. Eachus
1996-03-25  0:00     ` Robert Dewar
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox