Mail Archives: djgpp/1996/06/20/19:55:53
Reply to message 1896793 from JOHAN AT EINSTEI on 06/17/96 9:55AM
> int tmp;
> tmp = random(3);
>
>With Borland, no problemo, it compiles, with DJGPP version 2, nope ...
>What is it man ?
As has been said recently on the list, the problem is with the definition
of random() on the two compilers. DJGPP's random() doesn't take
any arguments, and returns a value from 0 to MAXINT. You can
easily mask or mod the value to get a number from 0 to 2, e.g.:
tmp = random() % 3;
John
P.S. Question for the gurus of the list: Is this the same question that
everybody replied to a while back? If so, why am I just seeing it now?
- Raw text -