Mail Archives: djgpp/1996/12/26/21:17:44
Aleksi Kallio wrote:
>
> What would be good seed function for srandom()?
> Something clock based of course, but which one?
> I didn't find any time function that returns int value. And srandom
> requires int value.
> Any good ideas?
Cast the return value of time() to an int, like so:
#include <stdlib.h>
#include <time.h>
int main( void )
{
srandom( (int) time( NULL ) );
...
}
--
---------------------------------------------------------------------
| John M. Aldrich, aka Fighteer I | fighteer AT cs DOT com |
| Plan: To find ANYONE willing to | http://www.cs.com/fighteer |
| play Descent 2 on DWANGO! | Tagline: <this space for rent> |
---------------------------------------------------------------------
- Raw text -