delorie.com/archives/browse.cgi | search |
From: | "Winston Kotzan" <WINZ AT prodigy DOT net> |
Newsgroups: | comp.os.msdos.djgpp |
Subject: | Re: Random number |
Date: | Sun, 19 Sep 1999 11:13:35 -0500 |
Organization: | Prodigy Internet http://www.prodigy.com |
Lines: | 14 |
Message-ID: | <7s31ut$6ram$1@newssvr04-int.news.prodigy.com> |
References: | <37E3E460 DOT E60AAC43 AT pepparkakor DOT demon DOT nl> <7s1fds$4s72$1 AT newssvr03-int DOT news DOT prodigy DOT com> <37E4895C DOT 2ECF45FA AT pepparkakor DOT demon DOT nl> <37E4E4D9 DOT 7408157 AT pepparkakor DOT demon DOT nl> |
NNTP-Posting-Host: | chcgb208-15.splitrock.net |
X-Trace: | newssvr04-int.news.prodigy.com 937757469 3351044 209.156.13.38 (19 Sep 1999 16:11:09 GMT) |
X-Complaints-To: | abuse AT prodigy DOT net |
NNTP-Posting-Date: | 19 Sep 1999 16:11:09 GMT |
X-Newsreader: | Microsoft Outlook Express 5.00.2314.1300 |
X-MSMail-Priority: | Normal |
X-Priority: | 3 |
X-MimeOLE: | Produced By Microsoft MimeOLE V5.00.2314.1300 |
To: | djgpp AT delorie DOT com |
DJ-Gateway: | from newsgroup comp.os.msdos.djgpp |
Reply-To: | djgpp AT delorie DOT com |
Sorry, I forgot to tell you that you need to initiate the random number seed. Use the srand() function to do that. It's described at http://www.delorie.com/djgpp/doc/libc-2.02/libc_630.html You need to enter a different number in srand each time to generate a new random number. Usually, they use the system's clock value. Sorry, but I'm not sure about much more of it, because I haven't really used the random functions for a while.
webmaster | delorie software privacy |
Copyright © 2019 by DJ Delorie | Updated Jul 2019 |