0Pricing
Zig Academy · Lesson

zig translate-c to Read C as Zig

Convert C source into Zig code.

Read C as Zig

Sometimes you want to see C as plain Zig source. The zig translate-c command converts a C file into readable Zig.

zig translate-c input.c

It Prints to stdout

By default translate-c writes the generated Zig to stdout. Redirect it to a file when you want to keep and edit the result.

zig translate-c input.c > out.zig

All lessons in this course

  1. Import C Headers with @cImport
  2. Calling C Functions and Linking
  3. C Pointers, Strings, and Types
  4. zig translate-c to Read C as Zig
← Back to Zig Academy