www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/02/25/03:10:32

From: Erik Max Francis <max AT alcyone DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Error??
Date: Mon, 24 Feb 1997 21:42:20 -0800
Organization: Alcyone Systems
Lines: 21
Message-ID: <33127BBC.48E0ABC7@alcyone.com>
References: <33123B5C DOT 6605 AT epix DOT net>
NNTP-Posting-Host: newton.alcyone.com
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Mr. Cup O. Slaw wrote:

>         These compile and run fine under C++v1.0 and TurboC++4.5 but when
> I try
> to compile them under djgpp I get the folloeing errors.

random is a non-standard function.  Thus you're not guaranteed that it will
have the same arguments on different compilers.

Use rand (which is not as good a pseudorandom number generator in DJGPP),
like this:

    roll = rand()%6 + rand()%6 + rand()%6 + 3;

-- 
       Erik Max Francis, &tSftDotIotE / email:  max AT alcyone DOT com
                     Alcyone Systems /    web:  http://www.alcyone.com/max/
San Jose, California, United States /    icbm:  37 20 07 N  121 53 38 W
                                   \
              "I am become death, / destroyer of worlds."
                                 / J. Robert Oppenheimer (quoting legend)

- Raw text -


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