C++ Programming/Code/Standard C Library/Functions/rand

rand
The function rand returns a pseudo-random integer between zero and RAND_MAX. An example:

The rand function must be seeded before its first call with the srand function - otherwise it will consistently return the same numbers when the program is restarted.


 * Related topics: srand