srand() and rand() functions
Hi all,
Is the srand() and rand() functions in VC++ an ANSI standard? Can I assume that if I were to use any other C compiler, the generated sequence of random number will be the same?
Does anyone know or has the source code of any random number generator that allows seeding?
Thanks in advance for any help.
Gladywin
Re: srand() and rand() functions
The rand and srand are ANSI standard functions for random number generator, but I don't think that ANSI tells to compiler developers, which algorithm to implement in this generator. So, it guarantees to you than rand or srand call will give you random number, but it doesn't guarantees to you that these numbers will be same on all compiler.
And if you search for random number generator algorythm, there are a lot of them. For example, look at Random number page in Yahoo : http://dir.yahoo.com/Science/Mathema...andom_Numbers/.
Jack.