Quote Originally Posted by Damian227 View Post
My set up doesn't seem to have 'Start without debugging' only 'Start debugging'
Oh, that's right. For some strange reason Microsoft removed the "Start without debugging" option from the menu by default in 2010. You can re-add it if you edit the menu if you want.

Anyhow, thats what I assumed I'd have to press, so I have done and it just comes up with this in the output...

The DOS window pops up but vanishes in a split second, then that appears in the output and nothing happens. Anybody know what this PDB thing is... which I assume is the problem?

Thanks for replying
There is, technically, no problem. Your program begins running. It needs a console window to run in, so one is opened. Your program writes its output to the window. Then your program finishes. Since it is no longer running, there is no reason for the console window to remain open, the same way your browser window disappears when you quit the browser.

FYI, "exited with code 0" almost always means "exited normally." Values other than 0 typically indicate an error.

If you want to see the output of your program before the window closes, then you need to either run the executable from a pre-existing console window (this is, technically, the "right" solution since this is how console apps are intended to be run, but isn't much help to beginners who are only used the "console app" program type because it's simple), or else you need to prevent the program from exiting until you wish it to do so.

For this latter approach, you can either set a breakpoint at the end of main since you're using "Start debugging" anyway, or you can add code which waits for user input on the console before exiting. If you select "Start without debugging", Visual Studio will be kind enough to automatically insert such code behind the scenes, but that's just a courtesy, not required behavior.