Mail Archives: djgpp/1998/09/22/09:30:39
On Tue, 22 Sep 1998 14:36:21 +0200, Martin Juul <mj AT mi DOT aau DOT dk> wrote:
>// filsplitter
>A file made in this way get a size bigger than 40bytes if compiled by
>gxx on dos(under win95)
>it looks to mee like a serious bug in the fstream?
>can anyone confirm that it poses a prob. to compile this under win95,
>maybe solve it?
You don't take into account that the number of characters in a text
file on disk is usually not identical to the number of chars "read".
An end of line is represented on disk by a byte sequence 13,10 (CRLF),
while a stream in text mode will convert this sequence into a single
char \n - and vice versa. Obviously among the 43 bytes read and
written were 3 CRLF sequences which were represented as a single \n in
your buffer.
Regards
Horst
- Raw text -