You are compiling a console application.
By design the "standard output window" is closed when the program is terminated. It also doesnt allow input by default (i wont talk about cmd options)
If you want to keep the window opened just let the program run , do not terminate it.
while(true)
{
processing
}
User will need to press ALt+F4 or the red cross to close it.
But most of the time its an horrible way of programming. You should put some failsafe mechanism in "processing" in order to avoid terrible side effects like infinite loops. The program must be able to break free from the loop in case of error and exit properly. Or just DONT DO THAT !
If i where you, i would simply launch the compiled program from the a bat/cmd file . It should work with a "pause "command in the cmd script..wait.... pause will still require user input haha