Post #1580599
2026-04-23 14:43 UTC
Beginner mistake, which is perfectly fine!
Just use i-1 inside the loop and i <= values.Length as the condition.
Replies (1)
-
@ChickenLadyLovesLife@lemmy.world 2026-04-24 03:38
My favorite: ``` for (int i = myArray.Length; i --> 0; ) { //do something } ``` Perfectly valid in C-style, even if it does look a bit puzzling at first.