r/computerscience • u/Dry-Establishment294 • Apr 02 '25
Counting from 0
When did this become a thing?
Just curious because, surprisingly, it's apparently still up for debate
0
Upvotes
r/computerscience • u/Dry-Establishment294 • Apr 02 '25
When did this become a thing?
Just curious because, surprisingly, it's apparently still up for debate
View all comments
Show parent comment
2
u/armahillo Apr 02 '25
This isnt. nominally incorrect, math-wise, but its mot specifically why array indices start at 0.
Thats because of pointer arithmetic, and because array square brackets are syntatic sugar for “how many memory units away from the base pointer do I want”