delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/05/10/09:31:58

Date: Sun, 10 May 1998 16:27:35 +0300 (IDT)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: WANKADIA PAUL SAPAL MICHAEL <wanpsm98 AT octarine DOT cc DOT adfa DOT oz DOT au>
cc: djgpp AT delorie DOT com
Subject: Re: PROBLEM WITH FUNCTION RAND()
In-Reply-To: <wanpsm98.894794690@octarine>
Message-ID: <Pine.SUN.3.91.980510162600.17143B-100000@is>
MIME-Version: 1.0

On 10 May 1998, WANKADIA PAUL SAPAL MICHAEL wrote:

> "C.Rothwell" <enquiries AT aditfree DOT com> writes:
> 
> >You could be clever and use the system clock to get a random number that was
> >diffrent every time you ran the program.
> 
> I tried that once and discovered that rawclock() always returns 0 (for 
> some ungodly reason).

Try harder.  There are time-related library functions other than 
`rawclock', use them instead.  The usual practice is to use the output of 
`time' as the seed, since `time' is ANSI-standard, whereas `rawclock' 
isn't.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019