I am trying new ways to generate random numbers and fill them in an array. So far I have done.
template<size_t SIZE>
void fill_array(array<int, SIZE>& a)
{
default_random_engine dre;
uniform_int_distribution<int> uid1(0, 1000);
for (int i = 0; i < a.size(); i++)
{
a[i] = uid1(dre);
}
}
My main file is very simply and looks like this
array<int, 10> a;
Array3 a1;
a1.fill_array(a);
a1.print_array(a);
I thought I managed to get random numbers everytime I debug but I get the same numbers everytime. Weird enough sometimes I do get different numbers but then it's the same thing where I have to debug multiple times to get new numbers. What did I do wrong?