This is the mail archive of the
cygwin@sourceware.cygnus.com
mailing list for the Cygwin project.
RE: get random numbers in C++ : implicit declaration ????
- To: <cygwin at sourceware dot cygnus dot com>
- Subject: RE: get random numbers in C++ : implicit declaration ????
- From: "Ajit George" <gajit at kurianinc dot com>
- Date: Sun, 20 Feb 2000 21:11:15 -0600
Did you include stdlib.h? On linux the man pages state which header file
prototypes the functions described.
Ajit
-----Original Message-----
From: cygwin-owner@sourceware.cygnus.com
[mailto:cygwin-owner@sourceware.cygnus.com] On Behalf Of Martin Henne
Sent: Sunday, February 20, 2000 8:26 PM
To: cygwin@sourceware.cygnus.com
Subject: get random numbers in C++ : implicit declaration ????
I tried to get random numbers in a C++
programm with the two functions
srand(number) // to initialize
x=rand() // to get a number
but the compiler gives me a warning that
says 'implicit declaration of function 'srand()''
and the same for 'rand()'. Is there another
way to get random numers in C++? I'm asking
because under linux the compiler will stop com-
piling. It is a error for the g++-compiler
that comes with the debian potato. After I
installed egcs, I got a warning, but the
compiling finished.
Under Cygwin its also a warning and no error.
Martin
PS.: I included the iostream.h and the time.h
mailto:webmaster@martinhenne.de
--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com
--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com