Skip to content

Latest commit

 

History

History

functions

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

Functions:

  • main.rs:

  • basic functions:

fn main() {
   helloworld(); 
}

fn helloworld() {
    println!("Hello, World");
}
  • passing strings to a func
fn main() {
    let name:String = String::from("NameOne");
    display(name);
}

fn display(param_name:String) {
    println!("Name: {}", param_name);
}