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
PTC MKS Toolkit for Professional Developers
PTC MKS Toolkit for Professional Developers 64-Bit Edition
PTC MKS Toolkit for Enterprise Developers
PTC MKS Toolkit for Enterprise Developers 64-Bit Edition
SEE ALSO
- Functions:
random() ,setstate() ,srandom()
PTC MKS Toolkit 10.4 Documentation Build 39.