random numbers

This is a discussion on random numbers within the C++ Programming forums, part of the General Programming Boards category; i used this function to get a random number and now the random numbers are picked in the same order ...

change the "seed" to the number generator (rand).
the rand() function is actually a pseudo random number generator meaning that the you get the same sequence each time with the same seed number. This is very useful in some programming areas such as games.

the number that starts the "random" generator.
for C/C++ it is
srand(int seed);
usually you use the system time as the seed so the program will run differently each time.
Otherwise you can pick a seed number for predictability.