TIP: Click on subject to list as thread! ANSI
echo: cis.tandy.coco
to: James Jones 76257,562 (X)
from: Jeff Dege 76426,211
date: 1990-05-03 23:00:33
subject: #3253-#C arrays

#: 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.

SOURCE: compuserve via textfiles.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.