0PricingLogin
Zig Academy · Lesson

Writing Output and Exit Codes

Report results and signal status.

Tools Talk Back

Reading input is half the job. A finished CLI also writes output and signals success or failure to whatever ran it. 📤

Two Output Streams

Programs have two channels: stdout for normal results and stderr for messages and errors. Keeping them separate lets users pipe results cleanly.

All lessons in this course

  1. Reading Command-Line Arguments
  2. Reading Files and stdin
  3. Writing Output and Exit Codes
  4. Package and Release the Binary
← Back to Zig Academy