Why does the indexing start with zero in 'C'?

前端 未结 16 2318
执念已碎
执念已碎 2020-11-22 16:22

Why does the indexing in an array start with zero in C and not with 1?

16条回答
  •  太阳男子
    2020-11-22 16:46

    For the same reason that, when it's Wednesday and somebody asks you how many days til Wednesday, you say 0 rather than 1, and that when it's Wednesday and somebody asks you how many days until Thursday, you say 1 rather than 2.

提交回复
热议问题