Files
simple-rust-tests/__ffi/rust_link_a/src/main.rs
2021-01-24 23:10:46 +08:00

14 lines
203 B
Rust

mod hello;
use std::ffi::CString;
use hello::print_line;
fn main() {
let str = "Hello world!";
let c_str = CString::new(str).unwrap();
unsafe {
print_line(c_str.as_ptr());
}
}