Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- extern crate rand;
- use rand::Rng;
- fn main() {
- const SIZE: usize = 33; // Watch out when SIZE > 32
- const MIN: i32 = 1;
- const MAX: i32 = 100;
- let mut array: [i32; SIZE] = [0; SIZE];
- for i in 0..SIZE {
- array[i] = rand::thread_rng().gen_range(MIN, MAX + 1);
- }
- println!("{:?}", array); // Error when SIZE > 32
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement