www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/06/03/12:30:24

Date: Mon, 3 Jun 96 10:23:45 MDT
Message-Id: <9606031623.AA08525@rgfn.epcc.Edu>
From: ad327 AT rgfn DOT epcc DOT Edu (Matt W. Spencer)
To: halibut AT kuhub DOT cc DOT ukans DOT edu
Subject: Re: use of srand with djgpp?
Cc: djgpp AT delorie DOT com
Reply-To: ad327 AT rgfn DOT epcc DOT Edu


>
>You'll have to forgive me if this question is too easy I'm a C
>beginner, but any it has to do with srand.
>
>To seed the random number table I always used srand(time(NULL)).
>I have both time.h and stdlib.h included. Djgpp refuses to accept
>this line of code. Is there any other way to do this?
>
>I download some programs hoping to find this answer but most
>of them had a randomize() function which Djgpp doesnt seem to touch
>and one of them even querried the user for the seed!

Try using:

srandom((unsigned)time(NULL));

That should work. randomize() is a Borland C function, I think.

Matt


--
GIVE A DAMN! PROTEST THE COMMUNICATIONS DECENCY ACT!
Internet Declaration of Independance: http://www.misha.net/~elfi/dec.html
EFF: Electronic Frontier Foundation: http://www.eff.org
ACLU: American Civil Liberties Union: http://www.aclu.org

- Raw text -


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