For Example : I want an array of 100000 elements. But if we use [0; 100000] it will definitely give me stack overflow error because fixed arrays are allocated in stack as far as I know in rust.
So what's the best way to create an array of 100000 in rust ?
When you crate an (unboxed) array it will be put on the stack. The stack does not have much memory though. When you box the array or use a vector, the memory will be allocated on the heap which is much larger.