Welcome to Web-News
A Web-based News Reader
Subject Re: random number generator
From Mike Parker <aldacron@gmail.com>
Date Thu, 31 Jul 2008 14:29:26 +0900
Newsgroups digitalmars.D.learn

Michael P. wrote:

> Anyways, I tried importing the std.c.stdlib and the std.c.time to use those exact same functions, but I got errors trying to use time(0) as a argument. Forgot to mention I tried that.

FYI, the time function doesn't take a 'number'. It takes a pointer to a
time_t. If the pointer is non-null, the function stores the returned
value in the memory to which the argument points. It's common to call
the function with a null parameter. In C, 0 is often used in code to
represent null. This is not supported in D. So you have to call the
function using the null keyword in place of the 0: time(null).

Recent messages in this thread
 
-# random number generator Michael P. 30-Jul-2008 03:28 pm
.-# Re: random number generator Koroskin Denis 30-Jul-2008 03:36 pm
..-# Re: random number generator Michael P. 30-Jul-2008 03:41 pm
...-# Re: random number generator Jarrett Billingsley 30-Jul-2008 04:27 pm
...|\# Re: random number generator Michael P. 30-Jul-2008 06:12 pm
...\# Re: random number generator (Current message) Mike Parker 31-Jul-2008 01:29 am