If a random generator function is not supplied to the random_shuffle algorithm in the standard library, will successive runs of the program produce the same random sequence
You may produce an identical result every run of the program. You can add a custom random number generator (which can be seeded from an external source) as an additional argument to std::random_shuffle
if this is a problem. The function would be the third argument. Some people recommend call srand(unsigned(time(NULL)));
before random_shuffle
, but the results are often times implementation defined (and unreliable).