www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/04/22/09:16:21

From: David Jenkins <me AT jenkinsdavid DOT demon DOT co DOT uk>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Help: Using the clock to seed srand()
Date: Tue, 22 Apr 1997 10:51:54 +0100
Organization: None
Distribution: world
Message-ID: <TAArpcA6oIXzEwOl@jenkinsdavid.demon.co.uk>
References: <335C6DB3 DOT 39D AT student DOT anu DOT edu DOT au>
NNTP-Posting-Host: jenkinsdavid.demon.co.uk
MIME-Version: 1.0
Lines: 29
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

In article <335C6DB3 DOT 39D AT student DOT anu DOT edu DOT au>, Alistair Phillips
<p9205755 AT student DOT anu DOT edu DOT au> writes
>Hi there,
>
>I'm having some trouble using the PC clock to seed srand()
>
>I have declared clock as
>
>unsigned int clock = (unsigned int *)0x0000046CL;
>
>then I call it
>
>srand(*clock);
>
>it compiles and links OK but when I run it I get a huge error message
>
>Can anyone please help me
>Alistair Phillips
>a DOT phillips AT student DOT anu DOT edu DOT au
I just use 

srand(time(0));

Is this wrong???

-- 
http://www.jenkinsdavid.demon.co.uk for Newbie C programmers and a larf. ;-)
David Jenkins

- Raw text -


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