From a205bbb1d286d78efbb325dac1d465c6908e0026 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Fri, 1 May 2020 22:21:17 +0200 Subject: Use extern type for CStr --- src/main.rs | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/main.rs') diff --git a/src/main.rs b/src/main.rs index fe151fe..c6ec961 100644 --- a/src/main.rs +++ b/src/main.rs @@ -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); -- cgit v1.2.3