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

Date: Tue, 25 Feb 1997 10:13:01 +0100 (MET)
From: Miguel Murillo <mmurillo AT ideafix DOT cps DOT unizar DOT es>
To: "Mr. Cup O. Slaw" <coleslaw AT epix DOT net>
cc: djgpp AT delorie DOT com
Subject: Re: Error??
In-Reply-To: <33123B5C.6605@epix.net>
Message-ID: <Pine.LNX.3.95.970225100207.29837C-100000@ideafix.cps.unizar.es>
MIME-Version: 1.0


On Mon, 24 Feb 1997, Mr. Cup O. Slaw wrote:

> I have two programs that use the function ra domize(); which I use to
					      ^	
> later represent a dice roll of three six sided dice. Example:
> 
> roll= (random(6)+1) + (random(6)+1) + (random(6)+1);
	
	#include <stdlib.h>
	long int random(void);
 	rand() ---> number (0...RAND_MAX)
	RAND_MAX = defined number in math.h or stdlib.h
      
        #include <stdlib.h>
        int rand(void);
	rand() ---> number (0...RAND_MAX)
	RAND_MAX = defined number in math.h or stdlib.h
 
	rand()===random()
	randomize(); It's a macro for initialize seek;
	  ^ 
> 
> 	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.
> 
> c:/djgpp/include/stdlib.h:101: too many arguments to funtion 'long int
				 ^^^^^^^^^^^^^^^^^^^^    
> random()
> 
> 	Ive tried compiling it using:
> 	gcc myfile.cpp -0 myfile.exe -lm
> 	gcc myfile.cpp
> 	gxx myfile.cpp -o myfile.exe -lm
> 	gxx myfile.cpp
> 	gxx myfile.cpp -pg
> 	gxx myfile.cpp -v
> and a few others I can't quite remember. Any help would be greatly
> appreciated. And please excuse my lack of knowledge if the answer is an
> obvious one. Thanks.
> 
> P.S. I have ver. 2.01
> 
> COLESLAW
> 

- Raw text -


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