Follow

Array indices correspond to meaningful positions, not elements. Array of N elements has N+1 meaningful positions. Array[i] is not the ith element of an array, it's the element ahead of the position that is i units ahead of the first meaningful position (or behind the position that is i units behind the last meaningful position). This is why we start at 0, just like on a number line. Nobody counts from 0.

Sign in to participate in the conversation
CleverLibre Social

CleverLibre Social is an inclusive social instance for open discussion, learning, and community.
All cultures welcome.
Hate speech and harassment strictly forbidden.