3 ms·
Zero indexing comes from pointer arithmetics, where the memory address of an array is the same as the address of the first item. So the address of the n'th item
by goto11 5y ago
Zero indexing comes from pointer arithmetics, where the memory address of an array is the same as the address of the first item. So the address of the n'th item is:
address_of_array + size_of_item * (n - 1)
Hence array[0] is the first item, array[1] is the second item and so forth.
Zero-based indexing does not change the meaning of ordinal numbers. You just have to be aware that ordinal numbers are different from index offsets.