You are viewing a single thread.
View all comments View context
6 points

Arrays start at 0

permalink
report
parent
reply
8 points

Array offsets start at zero. Indices start at one. Normal humans that aren’t stuck in CS101 count with indices.

permalink
report
parent
reply
5 points

You start counting with 1. If you’re counting floors, where you enter the building you step on floor #1 and walking upstairs you land on floor# 2. Just like how there isn’t a year 0 because we count the amount of time passed. You count the number of floors traveled.

permalink
report
parent
reply

Just Post

!justpost@lemmy.world

Create post

Just post something 💛

Community stats

  • 2.6K

    Monthly active users

  • 303

    Posts

  • 3.4K

    Comments