srand


Setting of type of pseudorandom number sequence

[Classification]

Standard library

[Syntax]

#include <stdlib.h>

void srand(unsigned int seed);

[Description]

This function assigns seed as the new pseudo random number sequence seed to be used by the rand call that follows. If srand is called using the same seed value, the same numbers in the same order will appear for the random numbers that are obtained by rand. If rand is executed without executing srand, the results will be the same as when srand(1) was first executed.