Date: Sun, 2 May 1999 11:38:00 +0300 (IDT) From: Eli Zaretskii X-Sender: eliz AT is To: Stephan cc: djgpp AT delorie DOT com Subject: Re: random() / randomizer / srandom(...) problems! In-Reply-To: <372AF740.2B18DBC@magic.fr> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Reply-To: djgpp AT delorie DOT com X-Mailing-List: djgpp AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk On Sat, 1 May 1999, Stephan wrote: > Hi have written a program that use random functions. > But the randomizer doesn't work! You need to call `srandom' with a different seed in order to get a different series of random numbers. The usual trick is to pass the current system clock as the seed. See section 22.22 in the DJGPP FAQ for more details. Also, `srandom' goes with `random', not with `rand'. If you need to randomize the series returned by `rand', use `srand' instead of `srandom'.