Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
9
Task/Array-length/Zig/array-length.zig
Normal file
9
Task/Array-length/Zig/array-length.zig
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
const std = @import("std");
|
||||
|
||||
pub fn main() !void {
|
||||
// left hand side type can be ommitted
|
||||
const fruit: [2][]const u8 = [_][]const u8{ "apples", "oranges" };
|
||||
const stdout_wr = std.io.getStdOut().writer();
|
||||
// slices and arrays have an len field
|
||||
try stdout_wr.print("fruit.len = {d}\n", .{fruit.len});
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue