VMS Help  —  CRTL  srandom
    Initializes the pseudorandom-number generator random.

    Format

      #include  <stdlib.h>

      int srandom  (unsigned seed);

1  –  Argument

 seed

    An initial seed value.

2  –  Description

    The srandom function uses the argument as a seed for a new
    sequence of pseudorandom numbers to be returned by subsequent
    calls to random. This function has virtually the same calling
    sequence and initialization properties as the srand function, but
    produce sequences that are more random.

    The srandom function initializes the current state with the
    initial seed value. The srandom function, unlike the srand
    function, does not return the old seed because the amount of
    state information used is more than a single word.

    See also rand, srand, random, setstate, and initstate.

3  –  Return Values

    0                  Indicates success. Initializes the state seed.
    -1                 Indicates an error, further specified in the
                       global errno.
Close Help