# C Interop

> Guide for Zig and C interoperability. Use when importing C headers with @cImport, exporting Zig functions to C, mapping C types, using translate-c, or linking C libraries.

- Skill: `vinnie357/c-interop` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx skillmds add vinnie357/c-interop`
- Raw SKILL.md: https://api.skillmd.com/api/skills/vinnie357/c-interop/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: vinnie357 (https://skillmd.com/u/vinnie357)
- Updated: 2026-09-10
- Page: https://skillmd.com/skills/vinnie357/c-interop

---


# Zig C Interop

Importing C libraries, exporting Zig to C, type mappings, and translate-c.

For type mappings, linking patterns, and string interop examples, see `references/c-interop.md`.

## Anti-fabrication

This skill follows `core:anti-fabrication`. Verified against zig 0.16.0 (locally
installed, claude-skills-204): `references/c-interop.md`'s type mappings and linking
snippets compile as documented — no corrections needed here. A related claim, that
`@cImport` emits a deprecation warning, was found wrong and corrected, but that
claim lived in the troubleshooting skill's compiler-error catalog, not in this file.
Re-verify against a locally installed `zig build-exe` with a real C header before
asserting a type mapping this skill doesn't cover — Zig is pre-1.0 and `translate-c`
behavior has changed across minor releases.

