VS2015 killing command prompt when using Debugger

Okay when using VS2015 on Windows 10 I open a Win32 Consol Application then type the following below as befits a newbies first program

#include "stdafx.h"
#include <iostream>


int main()
{
std::cout << "Hello World" << std::endl;
return 0;
}

After which I attempt to use my local debugger and expect to see Command Prompt come up saying "Hello World" right? Wrong, somehow VS2015 kills CP and looks such that the window flashes on the screen for a half second or more then flashes back to VS. Can someone give me instructions on how to go about correcting this problem? I'm a newbie but i'm not clueless enough to actually believe this is normal

Thanks Guys
Last edited on
1
2
3
4
5
6
7
8
9
10
11
12
#include <iostream>

int main()
{
    std::cout << "Hello World\n" ; // << std::endl;

    // wait for the user to hit <enter>
    std::cout << "press the <enter> key to exit: " ;
    std::cin.get() ;

    // return 0 ; // implicit
}
Thanks Borges.

Quick question. How is this different than using the "Start without Debugging" feature?

I just recalled that I was using the "Local Windows Debugger" on the tools standard bar vs doing the Ctrl + F5 function.
"Start without Debugging" just runs the program; it does not close the console window automatically

"Local Windows Debugger" runs the program under the (local, user mode) debugger.
See: https://msdn.microsoft.com/en-us/library/sc65sadd.aspx
Topic archived. No new replies allowed.