06.08.2013 Views

pSOSystem System Calls - Read

pSOSystem System Calls - Read

pSOSystem System Calls - Read

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

srand pREPC+ <strong>System</strong> <strong>Calls</strong><br />

srand Sets the seed for the random number generator (rand).<br />

#include <br />

void srand(<br />

unsigned int seed /* seed value */<br />

)<br />

Description<br />

Arguments<br />

Return Value<br />

Error Codes<br />

Notes<br />

See Also<br />

This function works in concert with rand(). The srand() function uses seed as a<br />

seed for a new sequence of pseudo-random numbers to be returned by subsequent<br />

calls to rand().<br />

For a given seed value, the sequence of random numbers generated is the same. By<br />

default, a sequence of random numbers is generated using a seed value of 1.<br />

seed Specifies the seed value.<br />

This function does not return a value.<br />

Refer to Appendix B.<br />

Callable From<br />

■ Task<br />

rand<br />

3-140 <strong>pSO<strong>System</strong></strong> <strong>System</strong> <strong>Calls</strong>

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!