How to write and call a function in Rust

1 Answer

0 votes
fn main() {
    let s1 = "rust".to_string();
    let s2 = "c".to_string();

    f(s1, s2);
}


fn f(s1: String, s2: String) {
	println!("{} {}", s1, s2);
}
 
 
 
 
/*
run:
 
rust c
 
*/

 



answered Apr 15, 2023 by avibootz
...