In the C Programming Language, the srand function initializes the sequence of pseudo-random numbers generated when the rand function is called.
The syntax for the srand function in the C Language is:
void srand(unsigned int seed);
seed
The seed value for the rand function. The seed value determines a particular sequence of random numbers when calling the rand function. If a program always uses the same seed value, the rand function will always get the same sequence of numbers.
The srand functiondoes not return anything.
In the C Language, the required header for the srand function is:
#include <stdlib.h>
In the C Language, the srand function can be used in the following versions:
Other C functions that are similar to the srand function: