SYNOPSIS
#include <stdlib.h>
char *initstate(unsigned int seed, char *state, int size);
DESCRIPTION
The
The seed parameter
specifies a starting point for the random-number sequence and
provides for restarting at the same point. The
After initialization, a state array can be restarted at a different point in one of two ways:
-
The
initstate() function can be used, with the desired seed, state array, and size of the array. -
The
setstate() function, with the desired state, can be used, followed by thesrandom() function with the desired seed. The advantage of using both of these functions is that the size of the state array does not have to be saved once it is initialized.
PARAMETERS
- seed
-
Specifies an initial seed value.
- state
-
Points to the array of state information.
- size
-
Specifies the size of the state information array.
RETURN VALUES
The
CONFORMANCE
UNIX 98.
MULTITHREAD SAFETY LEVEL
Unsafe.
PORTING ISSUES
None.
AVAILABILITY
MKS Toolkit for Professional Developers
MKS Toolkit for Enterprise Developers
MKS Toolkit for Enterprise Developers 64-Bit Edition
SEE ALSO
- Functions:
random() ,setstate() ,srandom()
MKS Toolkit 9.2 Documentation Build 16.