0Pricing
Zig Academy · Lesson

Your First main Function

Anatomy of a minimal Zig program.

Where Programs Begin

Every Zig executable starts at a function named main. The compiler looks for it and runs it first when your program launches. 🚀

Import the Standard Library

Most programs begin by pulling in tools. You bind the standard library to a name using @import, a built-in that loads a module.

const std = @import("std");

All lessons in this course

  1. Install Zig on Any Platform
  2. Your First main Function
  3. Printing with std.debug.print
  4. Compile and Run in One Step
← Back to Zig Academy