3 ms·
By the way there is an easier way to convert C style null terminated strings into an &str than the bespoke c_string function used in this article. You can use t
by monad_june 5y ago
By the way there is an easier way to convert C style null terminated strings into an &str than the bespoke c_string function used in this article. You can use the CStr type that is already in the rust standard library: https://doc.rust-lang.org/std/ffi/struct.CStr.html https://doc.rust-lang.org/std/ffi/struct.CStr.html