feat: add rust link a

This commit is contained in:
2021-01-24 23:10:46 +08:00
parent db388a6e37
commit c6e36fb414
9 changed files with 73 additions and 0 deletions

View File

@@ -0,0 +1,13 @@
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());
}
}