From 8437bd12a54c6fe62c92b9a27fef03a5ec2a35cf Mon Sep 17 00:00:00 2001 From: Mitja Felicijan Date: Sat, 14 Sep 2024 22:28:47 +0200 Subject: Added basic Zig and C interoperability example --- zig-c-interop/main.zig | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 zig-c-interop/main.zig (limited to 'zig-c-interop/main.zig') diff --git a/zig-c-interop/main.zig b/zig-c-interop/main.zig new file mode 100644 index 0000000..8d16cd1 --- /dev/null +++ b/zig-c-interop/main.zig @@ -0,0 +1,9 @@ +const print = @import("std").debug.print; + +const billy = @cImport({ + @cInclude("billy.c"); +}); + +pub fn main() void { + print("Billy says 2+4={d}\n", .{billy.sum(2, 4)}); +} -- cgit v1.2.3