in reply to srand producing the same sequence of random numbers
If you want a different set of pseudorandom numbers each time, then forget that srand even exists. The first call to rand will automatically seed the PRNG with a value based on the system clock, which will get you close enough to actual randomness for most practical purposes.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: srand producing the same sequence of random numbers
by pemungkah (Priest) on Oct 12, 2010 at 21:04 UTC |