COHERENT manpages

This page displays the COHERENT manpage for srand() [Seed random number generator].

List of available manpages
Index


srand() -- Random-Number Function (libc)

Seed random number generator
#include <stdlib.h>
void srand(seed) int seed;

srand()  uses seed  to  initialize the  sequence  of pseudo-random  numbers
returned  by   rand().  Different  values  of   seed  initialize  different
sequences.

Example

For an example of this function, see the entry for rand().

See Also

libc,
rand(),
stdlib.h
The Art of Computer Programming, vol. 2
ANSI Standard, §7.10.2.2
POSIX Standard, §8.1

Notes

For a  superior but non-standard random-number  generator, see the function
randl(), described in the Lexicon article libmisc.

srand()  cannot be  used  with any  of  the ``rand48''  functions.  For  an
overview of these functions, see the entry for srand48().