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

前端 未结 16 2523
执念已碎
执念已碎 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:54

    In array, the index tells the distance from the starting element. So, the first element is at 0 distance from the starting element. So, that's why array start from 0.

提交回复
热议问题