Can we see the output of program at dos prompt

Light Poster
10Dec2008,08:30   #1
kabirk007's Avatar
hi everybody,

anybody can tell me the way , how can i check my 'c' program output at dos prompt

plz. confirm this ASAP.

thanks
Amit
Go4Expert Founder
10Dec2008,09:08   #2
shabbir's Avatar
What compiler you are using because running the program should show you the output
Invasive contributor
10Dec2008,11:20   #3
neo_vi's Avatar
if u cannot see the output jus add a line in the end of the program
Code:
getch();
If it returns any error include the conio.h header at the beginning
Contributor
17Dec2008,12:33   #4
skp819's Avatar
write the getch(); at the end of the program.
getch(); is used for get one character from the user.
by doing that after execution of the program it will hold the screen and when you press any key then it will go to source code.
Mentor
17Dec2008,15:26   #5
xpi0t0s's Avatar
It depends why you can't see the output already. Does the window appear briefly then disappear before you get a chance to look at it? If so prompting for input as the last thing is one solution; running the EXE from a command prompt opened at the right place is another.
Go4Expert Founder
17Dec2008,17:28   #6
shabbir's Avatar
Just a silly question. Are you aware of printf / cout functions to display output.