I am trying to fill my array with random numbers using the following piece of code
#include<iostream>
#include<random>
int main(){
int n = 5;
int list[10];
std::random_device rd;
std::mt19937 eng(rd());
std::uniform_int_distribution<> distr(0, 1000);
for(int i=0;i<n;i++)
list[i] = distr(eng);
std::cout<<"The list of elements is: ";
for(int i=0;i<n;i++)
std::cout<<list[i]<<" ";
}
For n = 5, I always get the same output
562 726 348 916 6
For n = 6, I always get the same output
562 726 348 916 6 594
These numbers arent random, I also checked the entropy
std:cout<<rd.entropy();
This gives me the output
0
What am I doing wrong and how do I get random numbers in my array?