1. 16
    Rustlings primitive_types3: Create an array of numbers using Ranges
    29s

Rustlings primitive_types3: Create an array of numbers using Ranges

Chris Biscardi
InstructorChris Biscardi
Share this video with your friends

Social Share Links

Send Tweet

README for this exercise.

Chris Biscardi: [0:00] In primitive_types3, we can see that the Rust compiler expected an expression at ??? on line eight. We're supposed to create an array with at least 100 elements in it. Now, we could type out an array with 100 elements in it, but that would be quite time-consuming.

[0:14] Instead we're going to use the range. ..100 creates an array with the values through 100, incrementing by one integer, so zero, one, two, three, four, five, six, etc. Thus we have an array with greater than or equal to 100 numbers in it.