I just copied from http://social.msdn.microsoft.com/forums/en-US/Vsexpressvc/thread/1555ce45-8313-4669-a31e-b95b5d28c787/?prof=required :
The following works for me :-)
//////////////////////////////////////////////////// ///////////////////////////////////
Here is another reason the console might disappear. And the solution:
With the new version of Visual Studio 2010, you can see this behavior even if you use Ctrl + F5 aka "start without debugging". This is most likely because you created an "empty project" instead of a "Win32 console application." If you create the project as a “Win32 console application”, you can ignore it because it is not applicable.
In older versions, it will use the console subsystem by default, even if you select the "empty project", but not in Visual Studio 2010, so you need to install it manually. To do this, select the project in the solution explorer on the right or on the left (perhaps it is already selected, so you do not need to worry about it).
Then select "project" in the drop-down menu of the menu bar, then select "project_name properties" → "configuration properties" → "linker" → "system" and set the first property, the "subsystem" drop-down property to "console (/ SUBSYSTEM: CONSOLE)" . The console window should remain open after execution, as usual.
//////////////////////////////////////////////////// ///////////////////////////////////
Ming Feb 23 2018-11-11T00: 00Z
source share