Mail Archives: djgpp/1999/10/05/12:57:11
Sune Nielsen (sunegn AT image DOT dk) wrote:
[...]
> When I declare an array eg,
> int array[3];
> should I index it from 0 through 2 or should it be from 1 through 3,
> or could it even be from 0 through 3!?
0 through 2 (both ends inclusive). Which means there are 3 elements in
the array, altogether, thus the [3] in its declaration.
> I know this is really basic C-stuff, but the Kris Jamsa book I use
> apparently doesn't clearify this thoroughly (I'm confused anyway, 'cos
> I though I understood it)...
The message of this is clear then: that book obviously is of no real
use. You may have to consider dumping it and getting a better one. If
the author of a book on C doesn't manage to get even this extremely
basic and crucial fact across, chances are you'll never learn C from
it, properly.
--
Hans-Bernhard Broeker (broeker AT physik DOT rwth-aachen DOT de)
Even if all the snow were burnt, ashes would remain.
- Raw text -