Go4Expert

Go4Expert (http://www.go4expert.com/)
-   C++ (http://www.go4expert.com/forums/cpp/)
-   -   Can we see the output of program at dos prompt (http://www.go4expert.com/forums/output-program-dos-prompt-t15454/)

kabirk007 10Dec2008 08:30

Can we see the output of program at dos prompt
 
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

shabbir 10Dec2008 09:08

Re: Can we see the output of program at dos prompt
 
What compiler you are using because running the program should show you the output

neo_vi 10Dec2008 11:20

Re: Can we see the output of program at dos prompt
 
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

skp819 17Dec2008 12:33

Re: Can we see the output of program at dos prompt
 
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.

xpi0t0s 17Dec2008 15:26

Re: Can we see the output of program at dos prompt
 
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.

shabbir 17Dec2008 17:28

Re: Can we see the output of program at dos prompt
 
Just a silly question. Are you aware of printf / cout functions to display output.


All times are GMT +5.5. The time now is 11:52.