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
- Import C Headers with @cImport
- Calling C Functions and Linking
- C Pointers, Strings, and Types
- zig translate-c to Read C as Zig