indexzero
Indexzero, also referred to as zero-based indexing, is a convention in programming and data structures in which the first element of an ordered collection has index 0. In practice, the nth element has index n−1. This approach contrasts with one-based indexing used by some languages, where the first element is at index 1.
Rationale and use: Zero-based indexing aligns with memory addressing and pointer arithmetic in many languages. The
Alternatives and pitfalls: Some languages and communities prefer one-based indexing for its perceived alignment with human
Impact and scope: Zero-based indexing has become a de facto standard in many major languages, including C,