Hi i would like to ask if there is a way to get rid of the message "press any key to continue" after you run a c++ program ?? thanks!!
Hi i would like to ask if there is a way to get rid of the message "press any key to continue" after you run a c++ program ?? thanks!!
It only appears when you run it from the IDE, because VC runs another program which runs yours, then puts up the message.
It doesn't add any extra code to your program to do it - run it from a command.com/cmd.exe prompt to see :) It does it so that you don't lose the output straight away.
you can also put the following at the end of you program:
which basically pauses the program, waiting for something to be written.Code:cin >> whatever;
:)
I think there's at least two ways to run the module from within VC++, but I think only one of them does that.
Running it through the debugger won't give you that, but it does run a bit slower and certain things act differently (esp. when your program dies :D).Quote:
Originally posted by tbarnette
I think there's at least two ways to run the module from within VC++, but I think only one of them does that.
In short - F5 for debugger and no prompt. Ctrl-F5 for no debugger and a prompt :D