Guardian C Library Calls Reference Manual
Reference to Library Calls
Guardian TNS C Library Calls Reference Manual—128833 3-149
rand
rand
The rand function generates a pseudo-random number.
Return Value
is a pseudo-random value in the range 0 through 32767.
Usage Guidelines
•
You can call srand to reset the pseudo-random sequence generator to a new starting
point. See “srand” on page 3-171 for more information.
Example
This example generates a pseudo-random number and places it in x:
#include <stdlibh>
/* ... */
int x;
x = rand();
/* ... */
#include <stdlibh>
int rand(void);