#: 3259 S10/Tandy CoCo
03-May-90 23:00:33
Sb: #3253-#C arrays
Fm: Jeff Dege 76426,211
To: James Jones 76257,562 (X)
"int foo[2][6];" is a declaration that says foo is a pointer to an array of 6
ints. If this is a variable declaration, it is a constant pointing at an area
of memory large enough to hold two such arrays. If it is a parameter
declaration, it isn't pointing at anything in particular, and no memory is
allocated. C doesn't support multi-dimensional arrays, it supports arrays of
arrays, which isn't the quite the same thing. Given "int foo[2][3];", foo[1]
is an array of three ints, stored consecutively ( that is *foo[1] == foo[1][0],
*foo[1]+1 == foo[1][1]), so obviously it is in column-major order.
There is 1 Reply.
|