Mail Archives: djgpp/1996/06/03/12:30:24
>
>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 -