diff options
Diffstat (limited to 'tests/projects/zig/c_interop/src/main.zig')
| -rw-r--r-- | tests/projects/zig/c_interop/src/main.zig | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/projects/zig/c_interop/src/main.zig b/tests/projects/zig/c_interop/src/main.zig new file mode 100644 index 000000000..6cd61100d --- /dev/null +++ b/tests/projects/zig/c_interop/src/main.zig @@ -0,0 +1,11 @@ +const std = @import("std"); +const c = @cImport({ + @cInclude("mathlib.h"); +}); + +pub fn main() void { + const sum = c.c_add(3, 4); + const product = c.c_multiply(5, 6); + std.debug.print("c_add(3,4)={d}\n", .{sum}); + std.debug.print("c_multiply(5,6)={d}\n", .{product}); +} |
