Arrays as Arguments

fn main(){
  let mut array: [i32 ; 5] = [1,2,3,4,6];
  print\_arrays(array);
  println!("The elements: {array:?}");
}
fn print\_arrays(mut array:[i32; 5]) {
  array[0] = 89;
  array[1] = 90;
  array[2] = 91;
  array[3] = 92;
  array[4] = 93;
  println!("The elements: {array:?}");
}
Comments