3 ms·
Hang on, I was reading last night that Zig has no for loop? That you have to use while.... is this not correct?
by andrewstuart 4y ago
Hang on, I was reading last night that Zig has no for loop? That you have to use while.... is this not correct?
- messe 4y agoIt has no “for (init; cmp; step)” type loop, and instead you had to use: var i: usize = 0; while (i < sz) : (i += 1) { ... } Meaning that the scope for i would leak. It did have a foreach-style for loop, as seen in the article though.
- kzrdude 4y agoLooks like they have the most important part in place, the increment before the next iteration.