🦁

【Zig】C 言語のライブラリを利用する

2024/04/18に公開

まずは C 言語の標準ライブラリを使ってみる

const c = @cImport({
    @cInclude("stdio.h");
});

pub fn main() !void {
    _ = c.printf("Hello World!\n");
}

コンパイルと実行は次のとおり

zig run test.c -lc

Discussion