srand()

#include <stdlib.h>

void srand( unsigned int seed );

This function seeds the random number generator. Calling srand() with seed equal to 1 is equivalent to calling the rand() function without invoking srand().

See also: rand().


Back to Essential C Functions.