Mail Archives: djgpp/1998/01/22/09:45:22
Van Mo Dang wrote:
>
> Eli Zaretskii wrote:
>
> > > 2 - Which file should be included to know their prototypes ?
> >
> > None. Just declare the prototype yourself.
>
> Thank you for your fast answer and the information.
> Isn't it kind of unusual that the prototypes of these functions
> are not declared in any constant header file?
You do not understand or you pretend you don't understand. random() and
randomize(), etc are only MACROS, which does not belong to ANSI C. They
are popular IMHO because of Borland C (maybe some other compiler have
them as well). If you want to know sth more about random number
generators, just read the chapter from Numerical Recipes (it's available
on the net as postscript). There are examples or better and worse random
number generator. After reading it, you can take a look at the source of
rand.c in DJGPP. Or you can easily compile your own random number
generator.
One more thing random() is niether better nor worse than rand() /random
as a macro using rand/
You will never get random() numbers from computer, you can have only
pseudo-random numbers.
Mirek
- Raw text -