locked
Troubleshooting RRS feed

  • Question

  • Every time I want to run a program, it runs, but then as soon as I finish the last step, the window I'm seeing it in just closes so fast that I can't see the results. I've tried doing sytem "PAUSE", but that hasn't worked either. I'm using Visual Studio 08, and before, when I was programming Ruby, I never had this problem.

    Can anyone help me?

    Sunday, December 13, 2009 1:53 AM

Answers

  • Quote>I've tried doing sytem "PAUSE", but that hasn't worked either.

    There's no reason why it shouldn't "work", assuming that you code it
    correctly and not sloppily as above:

    system("pause"); // #include <stdlib.h>

    What happens if you run the program using Ctrl-F5 (Start Without Debugging)?

    - Wayne
    • Marked as answer by Wesley Yao Friday, December 18, 2009 3:26 AM
    Sunday, December 13, 2009 2:44 AM
  • Assuming it is a console application that you're talking about, put a getchar() function call at the end of the main function just before the return statement.
    «_Superman_»
    Microsoft MVP (Visual C++)
    • Marked as answer by Wesley Yao Friday, December 18, 2009 3:26 AM
    Sunday, December 13, 2009 8:09 AM

All replies

  • Quote>I've tried doing sytem "PAUSE", but that hasn't worked either.

    There's no reason why it shouldn't "work", assuming that you code it
    correctly and not sloppily as above:

    system("pause"); // #include <stdlib.h>

    What happens if you run the program using Ctrl-F5 (Start Without Debugging)?

    - Wayne
    • Marked as answer by Wesley Yao Friday, December 18, 2009 3:26 AM
    Sunday, December 13, 2009 2:44 AM
  • Assuming it is a console application that you're talking about, put a getchar() function call at the end of the main function just before the return statement.
    «_Superman_»
    Microsoft MVP (Visual C++)
    • Marked as answer by Wesley Yao Friday, December 18, 2009 3:26 AM
    Sunday, December 13, 2009 8:09 AM