≈ the.bay.news

Compilation error printing single command line argument

Ziggit
Compilation error printing single command line argument
Hi Folks, I have just starting playing around with Zig and found the following code which works for printing a program’s command line arguments: const std = @import("std"); pub fn main(init: std.process.Init) void { var args_iter = try init.minimal.args.iterateAllocator(init.gpa); defer args_iter.deinit(); var i: usize = 1; _ = args_iter.skip(); while (args_iter.next()) |arg| { std.debug.print("arg {d}: \"{s}\"\n", .{i, arg }); i += 1; } } I trie...

0 comments

Sign in to join the discussion — your thebay.events account works here.

No comments yet.