www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/02/23/18:44:17

From: gfoot AT mc31 DOT merton DOT ox DOT ac DOT uk (George Foot)
Newsgroups: comp.os.msdos.djgpp
Subject: Re: not so random numbers
Date: 23 Feb 1997 22:07:55 GMT
Organization: Oxford University
Lines: 15
Message-ID: <5eqf3r$893@news.ox.ac.uk>
References: <856730848 DOT 1887 DOT 0 AT slicksoft DOT demon DOT co DOT uk>
NNTP-Posting-Host: mc31.merton.ox.ac.uk
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

steve wilcox (stewilcox AT slicksoft DOT demon DOT co DOT uk) wrote:
: hi im having probs creating random numbers in djgpp i have made a
: define like so : 
: #define randomize() srand((unsigned)time(NULL))

: and im my code i call randomize() first but i still dont get random
: numbers using x = random()%100;

: anyone know whats wrong ?

Try using srandom instead of srand.

-- 
George Foot <gfoot AT mc31 DOT merton DOT ox DOT ac DOT uk>
Merton College, Oxford.

- Raw text -


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