this post was submitted on 08 Mar 2024
214 points (100.0% liked)

196

660 readers
28 users here now

Be sure to follow the rule before you head out.


Rule: You must post before you leave.



Other rules

Behavior rules:

Posting rules:

NSFW: NSFW content is permitted but it must be tagged and have content warnings. Anything that doesn't adhere to this will be removed. Content warnings should be added like: [penis], [explicit description of sex]. Non-sexualized breasts of any gender are not considered inappropriate and therefore do not need to be blurred/tagged.

If you have any questions, feel free to contact us on our matrix channel or email.

Other 196's:

founded 2 years ago
MODERATORS
 

A ruler with the logo for the Lua Programming language

you are viewing a single comment's thread
view the rest of the comments
[–] ezchili@iusearchlinux.fyi 3 points 1 year ago* (last edited 1 year ago) (5 children)

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]

[–] navigatron 2 points 1 year ago

But then arr.length == the last index, and that’s just too convenient :(

load more comments (4 replies)