Hacker News new | past | comments | ask | show | jobs | submit login

Indexes start at 1. Offsets start at 0.

Arrays in programming use offsets.

    for(int i=0;i<10;i++) 
    {
       array[i] = x;
    }
The error here is calling it 'i' for index. It should be 'o' for offset.



Arrays in the programming languages you’re familiar with use offsets.

Not all do [1].

1. https://therenegadecoder.com/code/which-programming-language...


Of course, and I've used Lua for a long time.

The point is that offsets and indexes have different meaning.


Where are you getting this definition of index?




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: