| Linux / Unix Command: rand |
NAME
rand, srand - random number generator.SYNOPSIS
#include <stdlib.h> int rand(void); void srand(unsigned int seed);
DESCRIPTION
The rand() function returns a pseudo-random integer between 0 and RAND_MAX.The srand() function sets its argument as the seed for a new sequence of pseudo-random integers to be returned by rand(). These sequences are repeatable by calling srand() with the same seed value.
If no seed value is provided, the rand() function is automatically seeded with a value of 1.
RETURN VALUE
The rand() function returns a value between 0 and RAND_MAX. The srand() returns no value.SEE ALSO
random(3), srandom(3), initstate(3), setstate(3)
Important: Use the man command (% man) to see how a command is used on your particular computer.

