| Program Programmer (39) | |||
what do you think guys ^^ | |||
|
Last edited on
|
|||
| iHutch105 (1092) | |
|
I would use the term advance loosely. Given that it's a simple program with no functions or OO code, it's not really advanced by C++ standards. Here's a question; what if I enter the word "foo" when asked for a number? Always make your software idiot-proof. :-) | |
|
|
|
| Program Programmer (39) | |
| it says it has bugs, and if you type foo it would type random numbers. im working on fixing the bugs, and BTW im using quincy 2005. is that a good editor? | |
|
Last edited on
|
|
| JLBorges (1756) | |||||
> unsigned long choice1;Use the type int for integers, unless you can state a specific reason as to why it should not be int.
Prompt the user for input, perhaps?
> system("color 3f");Requires #include <cstdlib> And you do realize that this is not a portable construct, don't you? Other than that, for a first program, it is just dandy. | |||||
|
|
|||||
| Program Programmer (39) | ||
what does #include <cstdlib> do for this program and the std::cout << "first number: and so on and if you think the system ("color 3f"); doesnt work, you didnt run it | ||
|
Last edited on
|
||
| JLBorges (1756) | |
|
> if you type foo it would type random numbers. Don't bother about that while writing your first program. Right now, just expect the user to type in two integers for input. > im using quincy 2005. is that a good editor? If you feel comfortable about using it, it is a good editor for you. | |
|
|
|
| Program Programmer (39) | |
| does int numbers allow more than 4 billion ? | |
|
|
|
| iHutch105 (1092) | |||
No, but it'll allow negative numbers. http://www.cplusplus.com/doc/tutorial/variables/ If you want a ridiculous range, you can use a long long. I suspect it might be overkill, though.
| |||
|
|
|||
| Program Programmer (39) | |
| oh well that all for now | |
|
|
|
| Filiprei (222) | |
| int usually allows just a little over 2 billion, but you should focus on relevant numbers for your calculator. If you have something specific you want to do with a program use long or long long. Congrats with a nice little program there. My first programs didn't have that cool output. You should make sure to include some cool interface/output to make it interesting. :) | |
|
|
|
| JLBorges (1756) | |
|
> what does #include <cstdlib> do for this program A name must be declared before it can be used. <cstdlib> is a header file, just as <iostream> is another header file. The header <cstdlib> has the declaration for the function std::system() just as <iostream> has the declaration for std::coutSo, if you want to use std::cout, #include <iostream> If you want to use std::system(), #include <cstdlib> > and if you think the system ("color 3f"); doesnt work, you didnt run it I didn't say it wouldn't work on a particular machine. I just pointed out that it may not work on every machine. | |
|
|
|
| Program Programmer (39) | |||
i got another problem now
nvm fixed it | |||
|
Last edited on
|
|||
| Kart (58) | |
|
Line 26. I believe line 13 may also require a semi colon; in future post the error logs also, it does help... | |
|
Last edited on
|
|