www.delorie.com/archives/browse.cgi | search |
From: | "Michael Stewart" <mike AT reggin DOT freeserve DOT co DOT uk> |
Newsgroups: | comp.os.msdos.djgpp |
Subject: | Re: random numbers |
Date: | Wed, 28 Jul 1999 16:11:20 +0100 |
Organization: | (Posted via) Netcom Internet Ltd. |
Lines: | 25 |
Message-ID: | <7nn6iq$hl9$1@taliesin.netcom.net.uk> |
References: | <7nn5h5$1v1$1 AT trex DOT antw DOT online DOT be> |
NNTP-Posting-Host: | hgty.capgemini.co.uk |
X-Trace: | taliesin.netcom.net.uk 933174682 18089 194.42.240.2 (28 Jul 1999 15:11:22 GMT) |
X-Complaints-To: | abuse AT corp DOT netcom DOT net DOT uk |
NNTP-Posting-Date: | 28 Jul 1999 15:11:22 GMT |
X-Newsreader: | Microsoft Outlook Express 4.72.3155.0 |
X-MimeOLE: | Produced By Microsoft MimeOLE V4.72.3155.0 |
To: | djgpp AT delorie DOT com |
DJ-Gateway: | from newsgroup comp.os.msdos.djgpp |
Reply-To: | djgpp AT delorie DOT com |
Simon De Deyne wrote in message <7nn5h5$1v1$1 AT trex DOT antw DOT online DOT be>... >Hi, > >Does anybody know how to use random numbers when using >gcc? Normally something like randomize() and random(10) >works to generate 10 integers on my MS-dos PC, but now i'm >trying to compile some stuff using djgpp and it doesn't work. >The faq said something about it, but only referred to the possibility >of using a rand(), but this doesn't allows setting limits to possible >random numbers. There are two random number functions in DJGPP rand() and random(). Both random() and rand() produce numbers between 0 and RAND_MAX. So to produce a random number between 0 and 99 x = rand() % 100; >Sorry if this might sound a bit too simple a problem, but i just started >out with djgpp. Problems tend to be simple if you know the answer, hard if you don't ;-)
webmaster | delorie software privacy |
Copyright © 2019 by DJ Delorie | Updated Jul 2019 |