Demo entry 2535658

Rust example

   

Submitted by Anthony Broad-Crawford on Aug 27, 2015 at 22:29
Language: Rust. Code size: 188 Bytes.

extern crate libc;

use libc::*;
use std::ffi::{CString};

#[no_mangle]
pub extern "C" fn hello_world() -> *const libc::c_char {
    CString::new("hello world").unwrap().as_ptr()
}

This snippet took 0.00 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).