0PricingLogin
Zig Academy · Lesson

C Pointers, Strings, and Types

Bridge C and Zig type systems.

C Types Get Translated

When Zig imports C, each C type maps to a Zig one. An int becomes c_int, so widths match the C ABI exactly.

const x: c_int = 10;

The C ABI Integers

Zig provides ABI-matching names like c_int, c_uint, c_long, and c_char so your values line up with what C expects.

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