I've been starting to write no_std Rust code and right now I'm trying to add strings.
This is my code:
#![no_std]
extern crate libc;
fn add_string(string: &str) {
const STRING1: &'static str = string;
const STRING2: &'static str = "String2";
const TEXT: &str = STRING1 + STRING2;
unsafe { libc::printf(TEXT.as_ptr() as *const _); }
}
#[no_mangle]
extern "C" fn main() -> ! {
add_string("String1 ");
}
Are there any good libraries for doing something like this in a no_std program?
Read the Docs
The answer is always there
My Solution: