I am calling to a random number generator function twice and theoretically should be getting 2 random numbers each time but instead I am being given the same number both times.
I have tried calling to the function in different way and replaced the integer in srand to 0 and null but still receive the same answer
int randomNUM()
{
srand(time(NULL));
int RL = rand() % 100;
return RL;
RL = 0;
}
int main()
{
int RL = randomNUM();
int RL2 = randomNUM();
cout << "RL: " << RL << endl;
cout << "RL2: " <<RL2 << endl;
}
I expect the results for RL and RL2 to be completely randomized numbers between 1-99 but instead get the same number for each of them.