por valor y por referencia

This commit is contained in:
2023-06-01 15:45:55 +02:00
parent cc4a953382
commit 9d9c7e21bb
4 changed files with 37 additions and 0 deletions

9
porvalor/src/main.rs Normal file
View File

@@ -0,0 +1,9 @@
fn agregar(a: i32, b: i32) -> i32 {
// como no tiene punto y coma este dato es retornado
a + b
}
fn main() {
let valor = agregar(3, 5);
println!("{}", valor)
}