Automatic Input To, "press any key to continue", to quit

I have a function that when activated, asks the user if they are sure they want to quit. I the use the exit(0) function if they say yes.

The exit(0) function display "press any key to continue..." and terminates the program once the user presses a key.

My question is; Is there a way I can automatically send the program a keystroke without the user pressing anything? This way, once they select yes, the program terminates without any further user interaction.
Last edited on
Are you running your program in debug mode?

Most moden IDEs with automatically do this for you. Try running it in Release (you will have to rebuild) mode and that extra prompt should go away.
I was running in debug mode. I tried running it in release, and unless I'm doing it wrong, it's giving me the same results.

I'm running in visual studio 15. I switch the drop menu that read "debug" to "release" and hit
ctrl + f5
Last edited on
Whoops. Scratch that.
Run it in debug mode.

Run it with F5 instead of Ctrl + F5.
Last edited on
Perfect, thankyou
Topic archived. No new replies allowed.