locked
sending output to file and display RRS feed

  • Question

  • Hi all!  I am trying to send output to a file and to the display.  I opened and closed my output file, and declared my ofstream variable.  When I just use cout, everything I want to output is shown on the display but is not sent to the output file.  When I use my ostream var (which I called outData) everything is sent to the output file but not to the display.  Can anyone help? 
    Thursday, October 22, 2009 9:07 PM

Answers

  • cout << ....

    outData << ...
    • Marked as answer by Wesley Yao Monday, October 26, 2009 8:33 AM
    Thursday, October 22, 2009 9:31 PM

All replies

  • Didn't understand what is your problem. Why don't you just send to cout and outData ?

    Thursday, October 22, 2009 9:26 PM
  • That's my problem.  How do I send it to both? Do I have to write the statement twice, once with cout and once with outData?
    Thursday, October 22, 2009 9:30 PM
  • cout << ....

    outData << ...
    • Marked as answer by Wesley Yao Monday, October 26, 2009 8:33 AM
    Thursday, October 22, 2009 9:31 PM
  • Thanks!
    Thursday, October 22, 2009 9:32 PM
  • Could you please close the thread
    Thursday, October 22, 2009 9:33 PM