Cout-ing on a new line in a text file

Alrite, so I have a text file.
Now when I run the program, it displays two sets
of output,the problem is when I try and write these outputs
to the text file, only the second is seen, the first one
seems to have disappeared.

any hints
In the immortal words from the IBM manuals:
solution: Correct the problem and re-run the program.
(Yes, that is a genuine quote).

But more seriously, I think you need to provide more information (post your code here) if you want some useful help.
Are you talking about redirecting the output of your program (which is using cout) to a file like

C:\Test>myprog > output.txt

(or similarly for Linux, etc)

If so, what O/S are you actually using?

If Windows, try

C:\Test>myprog > output.txt 2>&1

with appropriate app and file name.

(I think the syntax is valid for Linux, too; but I'm not sure.)

Andy
Last edited on
Topic archived. No new replies allowed.