I am learning Rust and I find that it does not allow variables to be left uninitialized when they are declared. Question is, I am trying to load input into an array but I don't want to initialize it because the size of the array may be rather large and I think initializing it with some temp value is not good. Currently, this piece of code does not pass the compilation:
let mut height: [u8; maxn];
let mut i = 1; // I want to start from 1, not 0, but this is not the main problem.
while i <= n {
height[i] = s_it.next().unwrap().parse().unwrap();
i += 1;
}
So, is there any way I can use?