[][src]Function tao_of_rust::ch13::ffi::hello_c

pub fn hello_c()

与其他语言交互

与C语言交互

Basic usage: Rust中调用C标准库函数

extern "C" {
    fn isalnum(input: i32) -> i32;
}
fn main() {
    unsafe {
        println!("Is 3 a number ?  the answer is : {}", isalnum(3));
        // println!("Is 'a' a number ? ", isalnum('a'));
    }
}Run