delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2005/03/12/01:06:30

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
To: cygwin AT cygwin DOT com
From: "Alex Vinokur" <alexvn AT users DOT sourceforge DOT net>
Subject: g++ & rand() in Cygwin
Date: Sat, 12 Mar 2005 08:04:59 +0200
Lines: 34
Message-ID: <d0u0pt$aj0$1@sea.gmane.org>
X-Complaints-To: usenet AT sea DOT gmane DOT org
X-Gmane-NNTP-Posting-Host: 85-64-1-155.barak.net.il
X-Newsreader: Microsoft Outlook Express 6.00.2800.1437
X-Gmane-MailScanner: Found to be clean
Cc: gcc-help AT gcc DOT gnu DOT org
X-Gmane-MailScanner: Found to be clean
X-Gmane-MailScanner-SpamScore: s
X-MailScanner-From: goc-cygwin AT m DOT gmane DOT org
X-MailScanner-To: cygwin AT cygwin DOT com
X-IsSubscribed: yes

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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019