g++ & rand() in Cygwin

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



------ 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




[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux