I have a program where I use drand48 and many parts of the program. The program requirement is such that you need the program to generate the same numbers each time, except for one part where i need to have the program generate different numbers in different runs.
Now if I use srand(time(NULL))
at the beginning of the program (as suggested in many forums), I end up changing all the numbers when I run the program multiple times.
If I use srand(time(NULL))
inside the relevant loop where I want the change to take place (across program runs), nothing happens and there is no change of random numbers.
Is there a solution to this ???