Output screen

November 17, 2009 at 13:58:01
Specs: Windows Vista
I am new to C programming. I have recently started to compile a few small basic programs and they seem to be working ok but when i go to run them, the o/p screen only allows you to enter ( say in a simple calculator program for instance) the two numbers that you want to calculate but then it ficks back to the source code. I can just about see the answer before the output screen disappears but would like to know if there is a way of freezing the o/p screen so that i can make sure the program is giving the right answer. At least until i press enter again to get it to return to the source code.
Regards Gerry

See More: Output screen

Report •

November 17, 2009 at 14:17:42
Add before ending the program


Report •

November 17, 2009 at 16:22:50
You said the screen "flicks back to the source code" - but that can I assume you are probably running your program from Visual Studio?

If so, pressing F5 run your program in the debugger. Set a breakpoint at the end of your main function to get a chance to see the results before it terminates.

Alternatively, you can press ctrl-F5 to run without debugging. In that case, the console window will automatically pause when your program finishes.

Report •

November 21, 2009 at 10:42:05
just add the line:
at the end of your program before the closing bracket of main.
it will hold the screen until you enter a character(after the normal program execution has terminated).
let us know if this helps.

Report •

Related Solutions

Ask Question