|
Syntax for C:<br /><br />#include <stdlib.h><br />int rand(void);<br />void srand(unsigned int seed);<br /><br />Defined in:<br /><br />rand.c in rts.src <br /><br />Description:<br /><br />Two functions work together to provide pseudorandom sequence generation:<br /><br />?The rand function returns pseudorandom integers in the range 0 - RAND_MAX. <br /><br />?The srand function sets the value of seed so that a subsequent call to the rand function produces a new sequence of pseudorandom numbers. The srand function does not return a value.<br /><br />If you call rand before calling srand, rand generates the same sequence it would produce if you first called srand with a seed value of 1. If you call srand with the same seed value, rand generates the same sequence of numbers.
|