I want to create an array as follows:
let arr = [0; length];
Where the length is usize . But I get this error
E0307 The length of an array is part of its type. For this reason, this length must be a compile-time constant.
Is it possible to create an array with dynamic length? I want an array, not Vec .
source share