use core {*}
// Using #dyncall dynamically loads the library at runtime.
#foreign #dyncall "libc.so" {
write :: (fd: i32, data: [&] u8, count: i32) -> i32 ---
}
main :: () {
msg: [] u8 = "Hello, libc!";
write(1, msg.data, msg.length);
}
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter