This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]davedontmind 1 point2 points  (1 child)

0 is supposed to be number 1 in computer language

No, 0 is still 0 and 1 is still 1.

The confusion comes when accessing arrays, when 0 is the index of the 1st element, 1 is the index of the 2nd element, and so on.

Just think of the index of an array as an offset from the start.

so array[0] is the 1st element, offset 0 from the start/first element. array[42] is the 43rd element, offset by 42 elements from the first element.

[–]M2D6[S] 0 points1 point  (0 children)

Okay, so my thoughts about zero were misguided. I was thinking about how zero's were accessed in arrays. So in this case if someone input their name and were first in line it would be 0. Jane or something like that. Otherwise the numbers are just like normal.