Skip to content

Instantly share code, notes, and snippets.

@ljmccarthy
Created April 8, 2019 10:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ljmccarthy/c373ee08c8f08d0e888ab263241c80bb to your computer and use it in GitHub Desktop.
Save ljmccarthy/c373ee08c8f08d0e888ab263241c80bb to your computer and use it in GitHub Desktop.
const std = @import("std");
pub fn main() !void {
const stdout = try std.io.getStdOut();
var direct_allocator = std.heap.DirectAllocator.init();
defer direct_allocator.deinit();
var arena = std.heap.ArenaAllocator.init(&direct_allocator.allocator);
defer arena.deinit();
var argsIter = std.os.args();
_ = argsIter.skip();
while (true) {
var arg = try (argsIter.next(&arena.allocator) orelse break);
try stdout.write(arg);
try stdout.write("\n");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment