this post was submitted on 08 Mar 2024
336 points (100.0% liked)
196
16449 readers
1937 users here now
Be sure to follow the rule before you head out.
Rule: You must post before you leave.
founded 1 year ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
There's a syntax for indexing starting from 0, it's
*(&arr+0) to *(&arr+(n-1))
For the rest of us who are manipulating sets of values and not offsets on pointers and aren't delusionally attached to conventions, there's arr[1] to arr[n]
But then arr.length == the last index, and that’s just too convenient :(