At http://www.cplusplus.com/reference/clibrary/cstdlib/rand/ , I read the following : This algorithm uses a seed to generate the series, which should be initialized to some distinctive value using srand.
What does seed mean and how does rand() use seed to generate the series?
Very crudely, it is something like:
And the
last_random_valis set to theseedwhen you callsrand(). Hence, for the same seed, same sequence of numbers are generated.