From: "Tony O'Bryan" Newsgroups: comp.os.msdos.djgpp Subject: Re: randomize? Date: Mon, 24 Nov 1997 19:31:21 -0600 Organization: Southwest Missouri State University Lines: 17 Message-ID: <347A2A69.73DE@nic.smsu.edu> References: Reply-To: aho450s AT nic DOT smsu DOT edu NNTP-Posting-Host: clark.a45.smsu.edu 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 wolfman AT cedar DOT alberni DOT net wrote: > > I know that Borland C++ has a function called randomize() that starts a new random seed. > Is there a function like this in DJGPP. If not, how can I start a new random seed? > It's pretty dumb to suppozidly have random things going on when every time you run a > program, the exact same thing happens. You can seed the random number generator with the current time like this: #include #include int main(void) { srandom(time(NULL)); <-- this is the important line }