Mail Archives: djgpp/1998/03/06/10:15:27
Ahn Ki-yung (KYAGRD AT mail DOT hitel DOT net) wrote:
[snip]
:
: What does this mean. I can't get any idea from the example.
: So I tried to find out the difference before calling the function
: "srandom"
: I tried several times but I couldn't find any difference!
: The return value of "random( )" was unpredictable all the time, before
: and after calling the functions "srandom". Please help me how to use
: this function.
actually it's very simple. if you use random without srandom, every time you
exucute the program you will get the same sequence of random numbers from
random. you can use srandom to get a different sequence of numbers from
random. Now if you somehow link the seed in srandom with the clock at
startup, your program will generate different random number sequences every
time you use it.
Regards,
Arne
--
Groeten,
Arne
--------------------------------------------------------------
- Raw text -