This is the mail archive of the
cygwin
mailing list for the Cygwin project.
g++ & rand() in Cygwin
- From: "Alex Vinokur" <alexvn at users dot sourceforge dot net>
- To: cygwin at cygwin dot com
- Cc: gcc-help at gcc dot gnu dot org
- Date: Sat, 12 Mar 2005 08:04:59 +0200
- Subject: g++ & rand() in Cygwin
------ foo.cpp ------
#include <cstdlib>
#include <iostream>
using namespace std;
int main ()
{
cout << rand() << endl;
cout << rand() << endl;
return 0;
}
---------------------
// g++ version 3.3.3 (cygwin special)
$ g++ foo.cpp
The program below generates the following output:
-----------
0
1481765933
-----------
First pseuso-random number is 0.
Is it by purpose?
--
Alex Vinokur
email: alex DOT vinokur AT gmail DOT com
http://mathforum.org/library/view/10978.html
http://sourceforge.net/users/alexvn
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/