there is a way to set the IDE to have this show up at the end of a run |
That is by default when launching the console program from the IDE (F5 [debug] CTRL+F5 [no debug]), and it can be turned off when launching a debug (F5) session. The "program pauser" is still active in a release (CTRL+F5) session, though you don't get all the program executable location and exit status output.
It doesn't matter how the console project is generated with the default setting, via wizard or as an empty project, VS will use their "program pauser" when the program ends. Normally or abnormally.
To not use the "program pauser" feature: Tools->Options->Debugging->General. Fourth option from the bottom, "Automatically close the console when debugging stops"
Personally I wouldn't recommend it. Or adding all this extra code to pause execution.
http://www.cplusplus.com/forum/beginner/1988/
Either run your program via the VS IDE, or in a command prompt console window.
As I said, it looks like the console window text was scrolled out of the window at the top. All the verbiage is there, just hidden. Try moving the scroll bar at the right up.
+----------+
Windows 10's File Explorer allows for an "easy" way to launch a command prompt. Click in the address bar, highlighting all the address. Type "cmd" and press enter.
You now have a command prompt opened with the address already entered.
Win10 allows you to drag and drop .exe files into the command prompt window, with the absolute adress as part of the file name. Hit enter, your program starts and finishes. The command prompt window stays open!
A command prompt is a Windows GUI program, so you can close it by clicking the X in the top right corner.
Or entering "exit" (without the quotes) and hitting enter.
I seem to remember earlier Win versions allowed this as well.
If I don't run a console program via the IDE I use a "cmd" command prompt. No code needed to artificially keep a console window open.