Rust Programming Tutorial #20 - Arrays

preview_player
Показать описание
Today we look at how to create and use arrays in Rust - they allow you to store a sequence of data one after another.

If this video helped you out and you'd like to see more, make sure to leave a like and subscribe to dcode!
Рекомендации по теме
Комментарии
Автор

Concise, detailed and well presented. Good job

kennethmarete
Автор

To loop through an array you could just "for element in array", you don't have to "array.iter()"

Edit:
I was quite the beginner
Unlike "while" loops, "for" loops can iterate on iterators, meaning the thing has to be an iterator OR you call ".iter()" or ".into_iter()" to make it iterable

Rust implicitly calls "._into_iter()" on arrays, so "for element in array" is the same as "for element in array.into_iter()"

NouifrUIwefdf
Автор

Can you change the length of and array after it is declared? Can can it be mutable, and let you change the value of elements? Are there commands similar to pop and push, in other languages?

Shakespeare
Автор

this appears to actually be useful, good job

multiHappyHacker
Автор

thank you so much for all of these short tutorials!! :D

DominoDude
Автор

is there any use of immutable values repeated hundred of times?

adsick_ua
Автор

Your loop goes from 0 to 5, why it does not crash when it does numbers[5] ?

sribagy
Автор

You should keep some questions to solve fro each topic so we can understand it ourself like 1 queions to solve using array concepts

MultiverseMayhemtoyou
Автор

Aren't there multidimensional arrays?

Sam-vgny
Автор

isn't an array already iterable?
can we not do this?:
fn main() {
let nums = [1, 2, 3, 4, 5, 6];
for n in nums{
print!("{} ", n);
}
}

samdavepollard
welcome to shbcf.ru