srand()

set seed for new sequence of pseudo-random numbers 

Function


SYNOPSIS

#include <stdlib.h>

void srand(unsigned int seed);


DESCRIPTION

The srand() function uses the argument seed as a seed for a new sequence of pseudo-random numbers to be returned by subsequent calls to rand(). Then, if srand() is called with the same seed value, the same sequence of pseudo-random numbers is repeated. If rand() is called before any calls to srand() have been made, the same sequence is generated as when srand() is first called with a seed value of 1.


PARAMETERS

seed 

Is the new seed value for subsequent rand() calls.


RETURN VALUES

None.


CONFORMANCE

ANSI/ISO 9899-1990.


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:
rand()


PTC MKS Toolkit 10.4 Documentation Build 39.