First, thanks for taking the time to read the rules about code tags :)
>>By the way, how come code tags aren't working properly... Shoulden't this be numbered now
you have to add the language like this:
[code=c++]
// your code here
[/code]
>>Unfortunately, when I use this button, after the program is finished, the command prompt automatically clos
If you want the program's window to remain open after the program finishes then you have to add another line just before main() returns to prompt for keyboard input so that the program will pause at that point.
Ancient Dragon
Retired & Loving It
30,049 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,343
When you compile using the command prompt you first have to open a command window. That window doesn't disappear after compiling or running your program.
Ancient Dragon
Retired & Loving It
30,049 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,343
I don't know -- I always use the IDE. But I do know its a lot more complicated than simply putting cin.get() at the end of main().
Ancient Dragon
Retired & Loving It
30,049 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,343
That problem has nothing to do with the compiler you are using. On line 37: when you enter a numeric value cin will not remove the key from the keyboard buffer. You need to strip that out. One way is to call cin.ignore() after line 37.
Ancient Dragon
Retired & Loving It
30,049 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,343