From: Dantalion Newsgroups: comp.os.msdos.djgpp Subject: random numbers Date: Thu, 01 Jan 1998 01:55:55 -0500 Organization: Pax Mortis Lines: 14 Message-ID: <34AB3DFB.25A@hotmail.com> Reply-To: dantalion AT hotmail DOT com NNTP-Posting-Host: ts2-10.nj.cnct.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk Ok, I have a little problem here... it seems I can't get DJGPP to generate a random number. I tried using something like srandom(34) then using r=random() and printf("%d", r), but it would always give me a large six or more digit number, and when I use rand() it would always give me a zero. Say I wanted a random number from 1 to 10, how would I do it? And also, how can I make it so that srandom takes a different seed every time the program is run, so that I get a different number each time? Thanks for any help you can give. -- Suddenly, I heard a tapping... as of someone gently rapping, rapping at my chamber door. You heard me rapping, right? --The Crow