How do i disable this in VS2005? i really wanna use my own not the default one
Printable View
How do i disable this in VS2005? i really wanna use my own not the default one
Huh?
It's a convenience since console apps are supposed to be run from a command prompt.
Plus I would disagree on using "your own solution."
That "press any key..." message is not there in your final EXE anyway, so what does it matter?
You can also run with debug, and it won't display that message.
I think the OP wants to use a different message instead of the standard one.
You can't really do that. In standard C++, the best you could get away with would be to print a message with cout or whatever, and then wait for input. Unfortunately, the user would have to hit enter to continue, not just any key, since C++ input is line-buffered.
Also see
http://faq.cprogramming.com/cgi-bin/...&id=1043284385
http://faq.cprogramming.com/cgi-bin/...&id=1043284385
For non-standard solutions, see
http://faq.cprogramming.com/cgi-bin/...&id=1043284392
For the heck of it, our own article :)
http://apps.sourceforge.net/mediawik...=Pause_console
You can include <conio.h> in your program. You could then do something like this:
Of course you can use whatever message you want in the cout().Code:cout<<"Press any key to continue"<<endl;
_getch();
Conio.h is non-standard, however, and thus should be avoided.
This "press any key ... " can be inconveniencing. On my console app, i have define a box area where inputs are entered ad out puts are shown. This bl##dy press any key just appears at the wrong places and messes up everything
Then just run in debug-mode and it will never appear.
It is not part of your application at all - it is part of the runtime environment that MS Visual Studio creates for your application to run in - it adds the "pause" command to the end of your application OUTSIDE of the application. If you run it from a command prompt window, then you won't see it (because it's not there).
--
Mats
It will not, simply because command line apps are not supposed to be run from the shell. They are supposed to be run from the cmd, if anything.
Ok, i've learnt that i could just use getch() instead of system("pause") which causes "press any key ..." .. But both seem not to be a good idea from few ... any ideas as to which function to call instead of the two to pause/halt ?