void srand(unsigned int);
void srandom(unsigned int);
(The type unsigned int is an integer type that only allows nonnegative values. You can think of the argument type asint with the restriction that it must be nonnegative.)
|
Reinitializes the random number generator. The argument is the seed. Calling srand multiple times with the same argument will cause rand or random (whichever you use) to produce the same sequence of pseudorandom numbers. If rand or random is called without any previous call to srand, the sequence of numbers produced is the same as if there had been a call to srand with an argument of 1. |
cstdlib |