Cout-ing on a new line in a text file

Oct 8, 2013 at 10:42pm
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
Oct 8, 2013 at 11:18pm
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.
Oct 8, 2013 at 11:30pm
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 Oct 8, 2013 at 11:35pm
Topic archived. No new replies allowed.