|This version of this document is no longer maintained. For the latest documentation, see http://www.qnx.com/developers/docs.|
Generate a pseudo-random integer in a thread-safe manner
#include <stdlib.h> int rand_r( unsigned int* seed );
- A pointer to the seed for the sequence of pseudo-random numbers. If you call rand_r() with the same initial value for the seed, the same sequence is generated.
Use the -l c option to qcc to link against this library. This library is usually included automatically.
The rand_r() function computes, in a thread-safe manner, a sequence of pseudo-random integers in the range 0 through RAND_MAX.
A pseudo-random integer.