Re: [Dev-C++] Please help with program bugs, i tried, no luck.
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: tayo o. <ta...@ya...> - 2001-01-18 21:36:21
|
Thanks for helping me out.
I appreciate this.
Tayo.
--- ropbert d baugh <lon...@ju...> wrote:
> Here is a program which will run. NOTE: Random not
> available in dev-c++
> libray that I can find.
> #include <iostream.h>
> #include <stdlib.h>
> #include <time.h>
>
> int roll(void); // protypes
>
> int dice_1; // Declared globals
> int dice_2;
>
> int roll()
> {
>
> dice_1 = 1;
> dice_2 = 2;
> // dice_1 = (random(6) + 1); // dev-c++
> does not have random
> function
> // dice_2 = (random(6) + 1); // that i can
> find . use bcc55 for
> this
> return dice_1; // anyone else
> have information on
> random??
> // return dice_2; // only one return value
> allowed
> }
> //int die1() // don't need these functions
> because
> //{ // dice declared global
> // return dice_1;
> //}
> //int die2_2()
> //{
> // return dice_2;
> //}
> int main()
> {
> // randomize();
> cout<<" the value rolled is : "<<roll()<<endl;
> cout <<" the first die was : "<<dice_1<<endl;
> // changed to int
> cout<<" the second die was: "<<dice_2<<endl;
> system("pause");
> // added pause so you
> can see
> return 0;
> // screen in console
> mode
>
> }
> On Thu, 18 Jan 2001 07:02:35 -0800 (PST) tayo
> odesanya <ta...@ya...>
> writes:
> > Intranet Compilers
> > Compilation Results
> >
> > 1 #include <iostream.h>
> > 2 #include <stdlib.h>
> > 3
> > 4 int dice_1;
> > 5 int dice_2;
> > 6 int roll()
> > 7 {
> > 8 randomize();
> > 9 dice_1 = random(6) + 1;
> > 10 dice_2 = random(6) + 1;
> > 11 return dice_1;
> > 12 return dice_2;
> > 13 }
> > 14 int die1()
> > 15 {
> > 16 return dice_1;
> > 17 }
> > 18 int dice_2()
> > 19 {
> > 20 return dice_2;
> > 21 }
> > 22 int main()
> > 23 {
> > 24 cout<<" the value rolled is :
> "<<roll()<<endl;
> > 25 cout <<" the first die was :
> "<<die1()<<endl;
> > 26 cout<<" the second die was:"<<die2()<<endl;
> > 27 return 0;
> > 28 }
> >
> > language: C and C++
> > options: Display all warnings
> > options: Include math library during linking
> >
> > prog.cpp: In function `int roll()':
> > prog.cpp:8: implicit declaration of function
> `int
> > randomize(...)'
> > c:/djgpp/include/stdlib.h:121: too many
> arguments to
> > function `long int random()'
> > prog.cpp:9: at this point in file
> > c:/djgpp/include/stdlib.h:121: too many
> arguments to
> > function `long int random()'
> > prog.cpp:10: at this point in file
> > prog.cpp: In function `int dice_2()':
> > prog.cpp:5: previous non-function declaration
> `int
> > dice_2'
> > prog.cpp:19: conflicts with function declaration
> > `int dice_2()'
> > prog.cpp: In function `int main()':
> > prog.cpp:26: implicit declaration of function
> `int
> > die2(...)'
> >
> > Errors Found!
> >
> > You need to correct the errors so that the
> program
> > compiles. The compiler was executed remotely from
> > MarketCache1.netcarrier.net/209.140.169.18 on
> > Thursday, January 18, 101, 8:51.
> >
> >
> >
> > Send comments to:ole...@ie....
> >
> >
> > __________________________________________________
> > Do You Yahoo!?
> > Get email at your own domain with Yahoo! Mail.
> > yahoo.com/
> >
> > _______________________________________________
> > Dev-cpp-users mailing list
> > Dev...@li...
> >
>
http://lists.sourceforge.net/lists/listinfo/dev-cpp-users
> >
>
> _______________________________________________
> Dev-cpp-users mailing list
> Dev...@li...
>
http://lists.sourceforge.net/lists/listinfo/dev-cpp-users
__________________________________________________
Do You Yahoo!?
Get email at your own domain with Yahoo! Mail.
http://personal.mail.yahoo.com/
|