3

I have third-party SDK code samples written in C++ (Console applications). When I run any of them from Visual Studio 2010 (Start without Debugging), it doesn't print "Press any key to continue . . ." in the end, Console window is just closed.

How did they manage to get such behavior? More important: how can I get standard "Press any key to continue . . ." in the end? Of course, without changing the program code...

Alex F
  • 42,307
  • 41
  • 144
  • 212
  • Why do you think you should get that message? Console applications are meant to be run from a command window and it would be counter-productive to show that message in an interactive session. – Mark Ransom May 21 '12 at 15:00

3 Answers3

8

Press Ctrl+F5 to run your program instead of just F5.

stirwl
  • 81
  • 1
  • 1
4

Change the subsystem to Console in the link settings

Gregory Pakosz
  • 69,011
  • 20
  • 139
  • 164
3

Try

system(PAUSE);

It should print what you are looking for

Cole Tobin
  • 9,206
  • 15
  • 49
  • 74