News for hackers. Stuff that matters.
Re:On Holy Wars and a Plea for Peace (1980) by goto11 on Monday August 02, 2021 @08:44AM (#28035787)
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.

There are no comments on this comment yet.