Mail Archives: cygwin/1998/12/15/10:21:34
On 13 Dec 98 at 16:04, Jan Tomasek <xtomasej AT fel DOT cvut DOT cz> wrote:
> Hi,
> I'm writing one school project in C and at home I working
> under CygWin 19.2
>
> On my Linux (Debian) is on random() man page writen that it is in
> defined in stdlib.h
> * if I compile it with gcc on that linux all is ok
> * if I compile it with Cygnus gcc port I get warning:
>
> In file included from sftpx.c:11:
> ftpx.c:9: warning: implicit declaration of function `random'
>
> Program is working correctly, I thing that random is hiden in
> some .a library.
>
> Does someone here known where is random definition?
>
> Thanks
> --
> Jan Tomasek, student FEL-CVUT
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> e-mail: xtomasej AT fel DOT cvut DOT cz www:
> http://mujweb.cz/web/tomasek/
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~H~
Hello!
Sorry to tell you, but random() isn't standard. Neither randomize()
is. You should use
void srand (unsigned int);
to start the (pseudo) random number generator and get the (pseudo)
random numbers with
int rand (void);
Both are defined in stdlib.h in any ANSI compliant compiler.
Sometimes the standard (pseudo) random number generators don't behave
in a statiscally random fashion, so people try to use enhanced
algorithms. If you trust Debian's algorithm and think it's better
than the standard one in CygWin, then you should get (LGPL>) Debian's
source of them at
http://www.debia.org
and compile it using CygWin tools.
If it is really a better algorithm and Cygnus accepts including it in
a next version, you'll be doing every CygWin user a good favor.
Best regards,
--Hilton
-------------------
Hilton Fernandes, M. Sc
email: hgfernan AT usp DOT br
Parallel Distributed Applications
at Escola Politecnica (Polytechnic School)
University of S. Paulo - Brazil
-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request AT cygnus DOT com" with one line of text: "help".
- Raw text -