Advertisement
cwchen

[Rust] function with parameters demo

Aug 23rd, 2017
353
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Rust 0.14 KB | None | 0 0
  1. fn hello(name: &str) {
  2.     println!("Hello, {}", name);
  3. }
  4.  
  5. fn main() {
  6.     hello("Michael");
  7.     hello("Tom");
  8.     hello("Alice");
  9. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement