www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/11/21/06:15:20

Date: Thu, 21 Nov 1996 13:03:49 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: Goncalo Farias <mad AT grupo DOT bfe DOT pt>
Cc: djgpp AT delorie DOT com
Subject: Re: Problems with djgpp 2.01
In-Reply-To: <9611210827.AA20803@grupo.bfe.pt>
Message-Id: <Pine.SUN.3.91.961121130139.23836A-100000@is>
Mime-Version: 1.0

On Thu, 21 Nov 1996, Goncalo Farias wrote:

> The problem, accordingly with others, is that i'm not using srand(). With
> version 2.0 i didn't need to do that.

Not true.  The following program, compiled with DJGPP v2.01, will 
continuosly print random integers until you press a key.  It works for 
me.  So there is no need to call srand.

#include <stdio.h>
#include <stdlib.h>
#include <conio.h>

int main (void)
{
  int x;

  while (!kbhit ())
    {
      x = rand ();
      printf ("Got %d\n", x);
    }

  return 0;
}

- Raw text -


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