learning-zig/lang/for.zig

16 lines
294 B
Zig
Raw Normal View History

2024-12-05 05:22:34 +00:00
test "for" {
const string = [_]u8{ 'a', 'b', 'c' };
for (string, 0..) |character, index| {
_ = character;
_ = index;
}
for (string) |character| {
_ = character;
}
for (string, 0..) |_, index| {
_ = index;
}
for (string) |_| {}
}