Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

With 1-based indexing, length == last index.

Does 0-based indexing have any advantage, beyond ability to do pointer arithmetic with indexes?



In 0-based indexing, n % length is a value inside the range.




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

Search: