Use extern type for CStr
This commit is contained in:
parent
fd2384b7fa
commit
a205bbb1d2
4 changed files with 105 additions and 17 deletions
|
@ -27,6 +27,11 @@ pub extern "C" fn main(_nargs: libc::c_int, _args: *const *const libc::c_char) -
|
|||
let _ = writeln!(stdout, "Foo: {} {} {}", z[0], z[1], z[2]);
|
||||
}
|
||||
|
||||
{
|
||||
let x = libc::string::CString::from("bar");
|
||||
let _ = stdout.puts(&x);
|
||||
}
|
||||
|
||||
{
|
||||
let b = alloc::boxed::Box::new(42);
|
||||
let _ = writeln!(stdout, "Bar: {}", b);
|
||||
|
|
Reference in a new issue