...

/

Solution Review 1: Declare an Array

Solution Review 1: Declare an Array

This lesson gives a detailed solution review of the challenge in the previous lesson.

We'll cover the following...

Solution:

Press + to interact
fn test() {
// define an array
let arr:[i32;6] = [0, 2, 4, 6, 8, 10];
// print the values of array
print!("{},{},{},{},{},{}",arr[0], arr[1], arr[2], arr[3], arr[4], arr[5]);
}

Explanation

  • On line
...