When I execute my program in Visual Studio (just a simple hello world app) it terminates and closes the console window immediately, rather than waiting for me to close it manually. I have gotten round this by including cin.get() at the end of the program, but my instructor has just told me that I shouldn’t have to do that, and that he was able to run the same program last night without having to enter the extra line.
Is this something in the setup of Visual Studio?
Update
I’ve tried using Ctrl+F5, but that just makes the console disappear even faster.
This is by design and your instructor is incorrect. Try launching a .bat file from a folder view and you get precisely the same behaviour!
You can
Set a breakpoint
Ask for user input via
Console.Readline()Run to cursor