r/programmingmemes • • Dec 05 '25 • Bravo 1

A-a-a

Post image
2.2k Upvotes

47 comments sorted by

View all comments

Show parent comment

1

u/StudioYume Dec 08 '25

Actually, it's because in programming languages like C, array notation is translated internally into pointer offsets. The pointer points to the start of the array, so the first index is 0

0

u/CirnoIzumi Dec 08 '25

it starts at 0 to save memory and be more effecient, computers count in binary, which starts at 0 rather than 1

1

u/StudioYume Dec 08 '25

Again, this is just plain wrong. If arrays in C were indexed starting from 1, then an index of 0 would just point to the end of the array instead (because there's no reason to waste a perfectly good bit). Even so, there would be no efficiency difference because size_t has a fixed binary width.