This is the mail archive of the
mailing list for the GCC project.
Re: cout Issue
- From: Jonathan Wakely <jwakely dot gcc at gmail dot com>
- To: Arthur Schwarz <aschwarz1309 at verizon dot net>
- Cc: gcc at gcc dot gnu dot org
- Date: Tue, 12 May 2009 09:13:42 +0100
- Subject: Re: cout Issue
- References: <firstname.lastname@example.org>
2009/5/12 Arthur Schwarz:
> Program and particulars below.
> When line 27 is commented out, line 26 is output. When line 27 is not commented, line 26 is not output except that if x.file contains a line feed the null line line 26 & line 27 are output. If x.file does not contain a line feed, only line 27 is output.
> Does the line feed have an effect on the 'cout <<' of line 26 of the program?
> Note. The code is awful and this is an example.
This question is off-topic on this list as it has nothing to do with
development of gcc, the gcc-help list or a C++ forum would be better.
I would guess that your file has DOS-style line-endings so a
carriage-return is output after line 26, and line 27 is overwriting
the output of line 26.