Mail Archives: djgpp/1996/11/21/06:15:20
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 -