Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" To: "JOA" , djgpp AT delorie DOT com From: Nate Eldredge Subject: Re: PROBLEM WITH FUNCTION RAND() Date: Sat, 9 May 1998 10:30:03 -0700 Message-ID: <19980509172947.AAH16984@ppp105.cartsys.com> Content-Transfer-Encoding: 8bit Precedence: bulk At 09:29 5/8/1998 +0200, JOA wrote: >Hello. >When i make a program (i want print a rand number into the screen) whit this >function or random function,and execute it a few times the random numbers >donīt change. >The function randomize() isn`t in the help of Rhide. >Thanks In DJGPP (and other ANSI systems), the function to seed the random number generator is `srand'. I think this was inadvertently omitted from the documentation in DJGPP 2.01, but what it does is to seed the RNG with its argument. If you want actual random numbers, you need to use some value that changes; `time(NULL)' is a good bet. If you want to use `random' instead (a better RNG, but a less portable interface), the corresponding function is `srandom'. Nate Eldredge nate AT cartsys DOT com