By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,277 Members | 1,505 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,277 IT Pros & Developers. It's quick & easy.

"row major" - technically no such thing in C?

P: n/a
Lax

Isn't it "technically" meaningless to call C a "row major language,"
since there are no such things as multidimensional arrays in C.

In C you can define arrays of arrays, and the way that the
declarations work (first index closest to identifier defines the
largest arrays) makes it seems like C has row-major multidimensional
arrays

No need to mention "row major" when discussing C if one talks about
"arrays of arrays" and the way C's declarations work "inside to
out." Correct, no?
And thanks to Ian Collins and Walter Robinson for your help with my
previous post (on 'static' externals).

Jun 27 '08 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Lax said:
>
Isn't it "technically" meaningless to call C a "row major language,"
since there are no such things as multidimensional arrays in C.
3.3.2.1 of C89: "Successive subscript operators designate a member of a
multi-dimensional array object."

6.5.2.1(3) of C99: "Successive subscript operators designate an element of
a multidimensional array object."

<snip>

--
Richard Heathfield <http://www.cpax.org.uk>
Email: -http://www. +rjh@
Google users: <http://www.cpax.org.uk/prg/writings/googly.php>
"Usenet is a strange place" - dmr 29 July 1999
Jun 27 '08 #2

P: n/a
In article <G4*********************@bt.com>,
Richard Heathfield <rj*@see.sig.invalidwrote:
>Lax said:
>>
Isn't it "technically" meaningless to call C a "row major language,"
since there are no such things as multidimensional arrays in C.

3.3.2.1 of C89: "Successive subscript operators designate a member of a
multi-dimensional array object."

6.5.2.1(3) of C99: "Successive subscript operators designate an element of
a multidimensional array object."
Nevertheless, it has been stated many times in this newgroup (by regs,
including you; no, I'm not going to google it) that C does not have
multidimensional arrays. It has been stated many times (yes, by you
among others) that it has arrays of arrays.

Of course, you claim that it doesn't have global variables, either...

Jun 27 '08 #3

P: n/a
Lax wrote:
Isn't it "technically" meaningless to call C a "row major language,"
since there are no such things as multidimensional arrays in C.
C language implements the concept multidimensional arrays as arrays of arrays.
It is absolutely incorrect to say that C doesn't have "multidimensional arrays".
It does. The only contexts when a statement like that like that can be valid are
the ones when the distinction between arrays of arrays and some other way of
implementing multidimensional arrays is important.
In C you can define arrays of arrays, and the way that the
declarations work (first index closest to identifier defines the
largest arrays) makes it seems like C has row-major multidimensional
arrays
No need to mention "row major" when discussing C if one talks about
"arrays of arrays" and the way C's declarations work "inside to
out." Correct, no?
Yes, that and the additional assumption that the inner single-dimensional arrays
represent specifically _rows_. Without such assumption, you'd only be able to
call them first-index-major or left-index-major.
--
Best regards,
Andrey Tarasevich
Jun 27 '08 #4

This discussion thread is closed

Replies have been disabled for this discussion.