(ANSI Standard)
#include <stdlib.h> srand( seed );
"srand" sets the "seed" for a pseudo-random number generator. Once the seed has been set, you may call "rand" to obtain pseudo-random numbers.
If you always use the same seed, you will always obtain the same sequence of pseudo-random numbers from "rand". This helps you to duplicate results for debugging purposes. A useful random sort of seed might be based on the time of day.
Copyright © 1996, Thinkage Ltd.