diff options
| author | Mitja Felicijan <mitja.felicijan@gmail.com> | 2024-09-14 22:28:47 +0200 |
|---|---|---|
| committer | Mitja Felicijan <mitja.felicijan@gmail.com> | 2024-09-14 22:28:47 +0200 |
| commit | 8437bd12a54c6fe62c92b9a27fef03a5ec2a35cf (patch) | |
| tree | 0934a84cbe4a9464ff762bf239845a9eb1260f29 /zig-c-interop/main.zig | |
| parent | 134f855b537b714eb98bc1e6e1e4790b4d6491a3 (diff) | |
| download | probe-8437bd12a54c6fe62c92b9a27fef03a5ec2a35cf.tar.gz | |
Added basic Zig and C interoperability example
Diffstat (limited to 'zig-c-interop/main.zig')
| -rw-r--r-- | zig-c-interop/main.zig | 9 |
1 files changed, 9 insertions, 0 deletions
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)}); +} |
