Mail Archives: djgpp/1997/02/25/04:32:02
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 -