in reply to srand producing the same sequence of random numbers
AFAIK, the only purpose for srand() is to be able to obtain a repeatable set of “random” numbers, e.g. for certain esoteric statistical sampling purposes or some similar special purpose. The intended behavior is exactly what you saw: after re-seeding, the pseudo-random sequence repeats.
The random number generator does not need to be re-seeded, ever, in normal practice.
The standard random number generator is not suitable for cryptographic purposes.
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: srand producing the same sequence of random numbers
by ikegami (Patriarch) on Oct 12, 2010 at 06:43 UTC |