Skip to main content
Version: Zig 0.12.0

C Primitive Types

Zig provides special c_ prefixed types for conforming to the C ABI. These do not have fixed sizes but rather change in size depending on the ABI being used.

TypeC EquivalentMinimum Size (bits)
c_shortshort16
c_ushortunsigned short16
c_intint16
c_uintunsigned int16
c_longlong32
c_ulongunsigned long32
c_longlonglong long64
c_ulonglongunsigned long long64
c_longdoublelong doubleN/A
anyopaquevoidN/A

Note: C's void (and Zig's anyopaque) has an unknown non-zero size. Zig's void is a true zero-sized type.