You need to use the same seed – as in, you must seed the generator only once. What’s more, you should use only one generator: there is no reason to use more than one, and it’s easy to introduce subtle errors with more than one.
Technically, for a good enough PRNG it doesn’t matter (as long as the seeds are distinct) but it won’t hurt either. For an inferior PRNG, using separate seeds may skew your results significantly if the seeds are correlated in any way (and they practically often are unless you seed from a true random device).
Be sure to use the new <random>
standard header in C++! std::rand
should be considered deprecated.