rand

Name

rand -- generate a pseudorandom integer

Synopsis

#include <stdlib.h>

long rand(void);

Description

These functions manage and provide a pseudorandom number sequence. To initialize the pseudorandom number sequence, call randomize() in your initialization procedures. After, call rand() for each new random number. The current random number is stored in a static-duration data object, and is updated on each call to rand().

See Also

srand, randomize, stdlib

Examples

Getting a random value example