summaryrefslogtreecommitdiff
path: root/tests/projects/zig/c_interop/src/main.zig
blob: 6cd61100dc831ff11d0e0dc78511aef6135836fd (plain)
1
2
3
4
5
6
7
8
9
10
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});
}