arrays, anyone?
Guy Harris
guy at sun.uucp
Mon Sep 16 09:20:20 AEST 1985
> >Now, to reference A(10,100):
> >
> > (*a)[99][9];
> WRONG!
> Declaring an array [99] means the valid values are from 0 -> 98 .
> See K&R page 20.
WRONG! The above code fragment is a reference, not a declaration (the word
"reference" in the first sentence might give you a clue here). If you check
the original article, you'll notice that the array was declared as having
more than 99 rows and having more than 9 elements in each row. As such, the
valid subscript values definitely include 99 for the first subscript and 9
for the second.
Guy Harris
More information about the Comp.lang.c
mailing list