14 lines
203 B
Rust
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());
|
|
}
|
|
}
|