www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/01/07/13:21:43

From: "Andrew Hurrell" <andrew AT acoustics DOT co DOT uk>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Random Number?
Date: 7 Jan 2000 17:04:11 GMT
Organization: Customer of Planet Online
Lines: 16
Message-ID: <01bf5931$22f95b60$9e9e883e@pa.wdi.co.uk>
References: <855200$31$1 AT hammer DOT msfc DOT nasa DOT gov>
NNTP-Posting-Host: modem-30.captain.dialup.pol.co.uk
X-Trace: newsg1.svr.pol.co.uk 947264651 18866 62.136.158.158 (7 Jan 2000 17:04:11 GMT)
NNTP-Posting-Date: 7 Jan 2000 17:04:11 GMT
X-Complaints-To: abuse AT theplanet DOT net
X-Newsreader: Microsoft Internet News 4.70.1155
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com


Nick Haines <nick DOT haines AT msfc DOT nasa DOT gov> wrote in article
<855200$31$1 AT hammer DOT msfc DOT nasa DOT gov>...
> How do you generate a random # in djgpp?  (Yes I'm a newbie)  Thanks for
any
> help you can give.
> 

If you #include <math.h> you will then be able to use the rand() or srand()
functions
(NB srand() allows you to seed the random number generator)

When you link don't forget to use the -lm switch to include the maths lib.

Andrew

- Raw text -


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