setstate

Restarts, and changes random number generators.

Format

char *setstate  (char *state;)

Arguments

state
Points to the array of state information.

Description

This function handles restarting and changing random number generators.

Once you initialize a state, the setstate function allows rapid switching between state arrays. The array defined by state is used for further random number generation until the initstate function is called or the setstate function is called again. The setstate function returns a pointer to the previous state array.

After initialization, you can restart a state array at a different point in one of two ways:

See also initstate, and srand48 in this section.

Return Values
A pointer to the previous state array information. 
Indicates an error. The state information is damaged. Further specified in the following errno value:

  • EINVAL-The state argument is invalid.
 


Previous Page | Next Page | Table of Contents | Index