different random number stream for different functions

Hi all,

I am wondering is there a way to make function A uses random number stream say starting from srand(1) and function B uses random number stream say starting from srand(2) in the same program.

Thanks
rand() is going to be deprecated soon for this exact reason.

http://en.cppreference.com/w/cpp/numeric/random
^ random number generators are independent objects with their own states
Last edited on
I am pretty new at this. Which one am I suppose to be looking at in that link?


Thanks
You should be looking at all of them to decide which one you think is best for your situation. For example, in most cases the Mersenne twister algorithm is good enough, but that depends on your situation.
Topic archived. No new replies allowed.