| delorie.com/archives/browse.cgi | search |
| Date: | Fri, 10 Nov 2000 12:11:36 +0200 |
| From: | "Eli Zaretskii" <eliz AT is DOT elta DOT co DOT il> |
| Sender: | halo1 AT zahav DOT net DOT il |
| To: | "tritesnikov" <tritesnikov AT hotmail DOT com> |
| Message-Id: | <7263-Fri10Nov2000121136+0200-eliz@is.elta.co.il> |
| X-Mailer: | Emacs 20.6 (via feedmail 8.3.emacs20_6 I) and Blat ver 1.8.6 |
| CC: | djgpp AT delorie DOT com |
| In-reply-to: | <GnIO5.10922$Wd3.1222073@typhoon.mn.mediaone.net> |
| (tritesnikov AT hotmail DOT com) | |
| Subject: | Re: random number generator |
| References: | <GnIO5.10922$Wd3 DOT 1222073 AT typhoon DOT mn DOT mediaone DOT net> |
| Reply-To: | djgpp AT delorie DOT com |
| Errors-To: | nobody AT delorie DOT com |
| X-Mailing-List: | djgpp AT delorie DOT com |
| X-Unsubscribes-To: | listserv AT delorie DOT com |
> From: "tritesnikov" <tritesnikov AT hotmail DOT com> > Newsgroups: comp.os.msdos.djgpp > Date: Fri, 10 Nov 2000 01:41:58 GMT > > srand(time(0)); > a = rand() % 5; > > This is more or less the standard way of doing a simple random number. FYI, section 22.23 of the DJGPP FAQ list explains why the above is a bad idea, and how to do this better.
| webmaster | delorie software privacy |
| Copyright © 2019 by DJ Delorie | Updated Jul 2019 |