Comment

Comment by codefreeordie

Arrays start at 0 because they're really just pointers. "[x]" is just shorthand for "+ x * sizeof". The first element is the one stored at the pointer address (0 sizeofs ahead of the pointer, the next element is stored 1 sizeof ahead of the pointer, etc.

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton