Re: Latest Usenet C Argument



James Kuyper wrote:

gw7rib@xxxxxxx wrote:
On 21 Dec, 09:35, Richard Heathfield <r...@xxxxxxxxxxxxxxx> wrote:
Why does C use zero-based indexing?

Many people find zero-based indexing difficult and non-intuitive. Why
doesn't C start indices from 1 instead? This would be much easier for
people.
...
D. None of the above, because...

You've missed one possible answer...

That's covered by D.

C uses zero-based indexing because BCPL uses zero-based indexing and
because this wasn't changed when BCPL was changed into C.

That merely moves the question back one step. Why did BCPL use
zero-based indexing? Keep recursing backwards as needed until you find
an actual reason.

Well, let's all go back to day zero...

In the beginning Brian created the stdio.h and the main().

And the main() was without form, and void; and darkness was
upon the face of the kernel. And the Spirit of Brian moved upon
the face of the kernel.

And Brian said, Let there be int and there was int main().

And Brian saw the int, that it was good: and Brian divided the
int from the void.

--
+-------------------------+--------------------+-----------------------+
| Kenneth J. Brody | www.hvcomputer.com | #include |
| kenbrody/at\spamcop.net | www.fptech.com | <std_disclaimer.h> |
+-------------------------+--------------------+-----------------------+
Don't e-mail me at: <mailto:ThisIsASpamTrap@xxxxxxxxx>

.



Relevant Pages

  • Re: Letter frequency of Chinese pinyin
    ... >Brian M. Scott wrote: ... >int compare ... >{register FREQ *p; ...
    (sci.lang)
  • Re: Letter frequency of Chinese pinyin
    ... Brian M. Scott wrote: ... int compare ... {register FREQ *p; ... register char *p; ...
    (sci.lang)
  • Re: Passing pointers?
    ... I have several introductory C books Brian. ... void x ... int z=99; ... have you bought yourself an introductory book on C as I have suggested? ...
    (microsoft.public.vc.language)
  • Re: Typecasting Pointers
    ... brian wrote: ... My mistake. ... Since the second argument is an int and NULL ...
    (comp.lang.c)
  • Re: Latest Usenet C Argument
    ... SM Ryan wrote: ... # Many people find zero-based indexing difficult and non-intuitive. ... array(1,5,int,twice); int i; ... n1256 6.5.6p9 states "If both the pointer operand and the result point to elements of the same array object, or one past the last element of the array object, the evaluation shall not produce an overflow; ...
    (comp.lang.c)