Use srand() twice in a function?
Can I use the srand() function twice in a function like so?
Code:
void delaycalc(void)
{
int one;
int result;
srand((unsigned)time(NULL));
one = rand();
srand(one);
result = rand() % 1200;
printf("%i", result);
}
You see I'm trying to get random numbers that are 1200 or less. However, when I use the time function to make a seed and loop the function so it displays 20 random numbers, it increments slowly like 2390, 2394, 2398 etc.
So it's hardly random. So can I use two srand() functions to try and randomise it more (Preferably so the values move down sometimes aswell)?