TIP: Click on subject to list as thread! ANSI
echo: cis.tandy.coco
to: Jeff Dege 76426,211 (X)
from: Pete Lyall 76703,4230
date: 1990-05-04 09:31:56
subject: #3259-#C arrays

#: 3268 S10/Tandy CoCo
    04-May-90  09:31:56
Sb: #3259-#C arrays
Fm: Pete Lyall 76703,4230
To: Jeff Dege 76426,211 (X)

I beg to differ..... int foo[2][6] does NOT declare an array of 6 ints...

In 6809/os9 (as in PDP-11 C), the int is a two byte entity. If you were to
declare 'int foo[6]', THAT would be an array of 6 ints, and 'foo', by C
convention, would be a pointer to the 0th element of that array. The allocation
of two bytes for each element off the array is implicitly handled by the
compiler, which will internally do the equivalent of 'sizeof (int)' when
staging the array.

In the case you specify (foo[2][6]), that will generate an array of 12 ints (24
bytes), or if conceptually easier to digest, 2 rows of 6 ints each. Pete

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™.