Why Do Arrays Start At Zero

A bit of history:

1 Like

i think it was more the memory position, as example if the struct is 64 bytes the offset it
0 * 64
1 * 64
2 * 64

If you ever programmed Assembly, you are used to use offset math to do all kinds of indexed things, and offset math is shorter and faster if zero based. In the computing field it is the “natural” way of indexing things. This way of thinking just migrated from the low level world to the high level languages.

Of course.

I found the article referenced an interesting bit of computer history.

Well , actually

And for an article that is headed “WHY do arrays…”
it spends an awful lot of time not actually being able to provide an answer, just a lot of reasons why they might not have been.

1 Like

I’d have said that the index is the offset to be added to the base address of the array to get the first item, second, … and left it at that.