• C

saving output

I want 2 save the output of my c program after running it and later send it to a cd.how can i save the output?
Who is Participating?
brettmjohnsonConnect With a Mentor Commented:
You can redirect the output to a file using stdout redirection:

myprogram > aFile

If you need to see the output on the console AND capture it to a file, use the 'tee' command:

myprogram | tee aFile

Kent OlsenData Warehouse Architect / DBACommented:
Hi shilpi84,

Note that you'll have to write to stdout.  You can NOT use the terminal I/O routines.

Good Luck!

if u r runnnig windows

run the console window (dos window) in full screen mode

press print screen  ( the button to the right of Function keys)

now open notepad
paste it ( Ctrl + V ) in notepad and save it
Which operating system are u using?

If Linux use
          > ./a.out filename > outputfile
          > cat outputfile
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.