I/O transfers data between a program and external resources. In Zig, std.Io provides an interface for file I/O, buffering, asynchrony, and concurrency while leaving programmers in control of buffering and its memory. section 1.6.2
Listing 1.2 All your codebase still belong to us
const std = @import("std");
pub fn main(init: std.process.Init) !void { #1
const io = init.io;
const stdout = std.Io.File.stdout(); #2
var stdout_buffer: [1024]u8 = undefined;
var stdout_writer = stdout.writer(io, &stdout_buffer); #3
const writer = &stdout_writer.interface; #3
try writer.print("All your codebase still belong to us!\n", .{}); #4
try writer.flush(); #5
}
A small Zig program writes a greeting to standard output through a buffered writer, then explicitly flushes it. section 1.6.2





