Rust_FFI_C언어

link


hello world(C_FFI)_printf(C)

code ex코드예시

use libc::printf;

fn main() {
    unsafe {
        let print_x = (r#"hello c__FFI(Rust Lang)"#.as_ptr()) as *const i8;
        printf(print_x);
    }
}
  • Result
hello c__FFI(Rust Lang)⏎