Re^2: Why does C hate 2d arrays?

diamond@tkovoa diamond at tkou02.enet.dec.com
Mon May 28 14:48:03 AEST 1990


In article <755 at ssp11.idca.tds.philips.nl> dolf at idca.tds.PHILIPS.nl (Dolf Grunbauer) writes:
>In article <265e1de4-26d.17comp.lang.c-1 at vpnet.chi.il.us> akcs.fish at vpnet.chi.il.us (Gil Winograd) writes:
>>Recently I had to write C code to handle a data structure which
>>consisted of *variably dimensioned* AND *variable size per dimension*
>>arrays. Of course, it was implemented as a one-dimensional array,
>>through which I had to go through involved calculations to get the
>>index right
>>Does Algol/Pascal handle this situation any better?
>
>No, the number of dimensions is fixed in Algol6{0,8}/Pascal.
>APL & APL2 are the only languages I know of which allow changing the
>number of dimensions of an array at run-time.
>Maybe we should continue this non-C discussion in comp.misc ?

Mr. Grunbauer's excerpt of Mr. Winograd's posting (which I did not edit
any further) has 5 lines about C and one line about non-C.  The two
postings together have 5 lines about C, 4 lines about non-C, and one
line asking a question.  I'd say the answer is no, that a posting which
is half about C, and compares C to other languages, somewhat suits the
comp.lang.c newsgroup.

I also just observed Henry Spencer telling another poster that his
question belonged in a hardware-specific newsgroup.  The person who
posted the question did not know that his problem was machine-dependent.
He properly read the manual, tried his best to obey it, and wondered
why it didn't work.  Correct advice would be to say that in a hardware-
specific newsgroup, a useful answer could be obtained more easily.

Yes, there's a lot of junk that doesn't belong in comp.lang.c, and
like many others, I am also irritated by wading through it.  But let's
not go overboard and criticize innocents.

-- 
Norman Diamond, Nihon DEC     diamond at tkou02.enet.dec.com
Proposed group comp.networks.load-reduction:  send your "yes" vote to /dev/null.



More information about the Comp.lang.c mailing list