K
kal
To someone with a solid assembly background, 0-based indexing appears as
the most natural option, because this is how indexed addressing modes
work on most processors supporting them. And the processor for which
C was originally designed was no exception.
I don't have a solid background in assembly, or in anything
else for that matter; still, I find zero based counting
(not to mention indexing) convenient.
For instance, if the years had started at 0 we wouldn't have
had all the argument about if 2000 or 2001 is the start of the
new millennium.
Zero based counting also uses the full value set of any given
number of bits.
Then there are conveniences such as:
string[length] = 0;
for(i = 0; i < size; i++) a += b[i%8];
IMHO the list is quite long. So, the question should not be
why the indexing starts at zero in C but rather why it doesn't
start at zero in some languages.
Hope you had a great vacation.
</OT>