Created
January 21, 2020 19:43
-
-
Save mikdusan/b73d013e8ec25c29c61d77bb9fc78a50 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const std = @import("std"); | |
pub fn main() !void { | |
var arena_impl = std.heap.ArenaAllocator.init(std.heap.page_allocator); | |
const arena = &arena_impl.allocator; | |
defer arena_impl.deinit(); | |
var buf = try std.Buffer.init(arena, ""); | |
var in_impl = std.io.getStdIn().inStream(); | |
var in = &in_impl.stream; | |
const bytes = try std.io.readLineFrom(in, &buf); | |
std.debug.warn("read: {}\n", .{bytes}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment