to get the output of c in a text file?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • cathykutty
    New Member
    • Mar 2010
    • 2

    to get the output of c in a text file?

    thanks for replying my previous question....... ...

    it worked and nw to get the print of the file that had run successfully what should i do..........

    my friends suggested me to using prnt screen and den paste in paint.......... .

    but i couldn get dat,,,,,i wanna get output printd ........
    pls do help me

    thanks in advance........ .....:)
  • Banfa
    Recognized Expert Expert
    • Feb 2006
    • 9067

    #2
    If it is a windows program then using <PrintScreen> or <Alt>-<PrintScreen> (to capture the focused window only) is your best bet.

    If it is a console program and you are outputing using printf or a similar function then you have a couple of options.

    Programatically you could add lines of code that close the current stdout and open a file in place of it.

    A little more simply you can use the pipe capabilities of the command line. Assuming that you program is call test.exe and you want the results in results.txt then either
    text.exe > results.txt

    or
    text.exe >> results.txt

    The first line deletes the current contents of results.txt, the second method appends the output of the program to the current contents of results.txt.

    Comment

    Working...