Path: csiph.com!news.swapon.de!eternal-september.org!feeder.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail From: Keith Thompson Newsgroups: comp.lang.c Subject: Re: just a curiosity about starting array indexing at 0 as opposed to 1 Date: Mon, 23 Nov 2015 11:01:02 -0800 Organization: None to speak of Lines: 19 Message-ID: References: <2df732fe-b6ed-47a2-b61d-30d45a7cab91@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: mx02.eternal-september.org; posting-host="945944de09706c9b4e29b53c9d2efdc2"; logging-data="14743"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX190L9UqWHnpK1RmF7V39xjl" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) Cancel-Lock: sha1:ZG6Oj5/e5REnUxkvjx4UKVAlnM0= sha1:t513220H3AHdO/Ix3WXjVj7zvk8= Xref: csiph.com comp.lang.c:77020 Ian Collins writes: > G G wrote: >> Just a curiosity about C starting array subscripts at 0 as >> opposed to starting at 1. >> >> Did Kernaghan or Ritchie ever explain why they chose to >> have array subscripts start a 0? > > To match the chapter numbering in their book? It is perhaps mildly interesting that K&R1 refers to the Introduction as "Chapter 0", but K&R2 (at least in the Kindle version I have) does not. -- Keith Thompson (The_Other_Keith) kst-u@mib.org Working, but not speaking, for JetHead Development, Inc. "We must do something. This is something. Therefore, we must do this." -- Antony Jay and Jonathan Lynn, "Yes Minister"