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.