Pass by Value
fn main()
{
let x:u32 = 10;
let y:u32 = 20;
// => 200
println!("Calc: {}", cal\_rect(x, y));
}
fn cal\_rect(x:u32, y:u32) -> u32
{
x * y
}
Comments
fn main()
{
let x:u32 = 10;
let y:u32 = 20;
// => 200
println!("Calc: {}", cal\_rect(x, y));
}
fn cal\_rect(x:u32, y:u32) -> u32
{
x * y
}