Mail Archives: djgpp/1998/08/01/09:31:04
Jamie Love schrieb:
> Hi, I have coded some file routines for my linked list class, but when I
> write the file (I won't bore you with the details) it seems that
> something goes wrong.
>
> Ie, I print out 11 integers and get a 45 byte file. How is this possible
> if I open this file in binary mode
>
So 11 multiplied by sizeof(int) which is 4 results to 44.The 45 might be a
terminator (don't know).
You ever opened your file with a text editor and checked weather it's really
writing
binary values??
> ie, with the line
>
> ifstream infile("test.txt", ios::bin);
>
> and
>
> iostream outfile("test.txt", ios::bin);
>
> It works out that for the first 14 integers everything is ok, but after
> that things get totally out of whack.
>
Thought you told about 11 integers?
> Anyone have any ideas?
> --
> Jamie Love
>
> - jamie DOT love AT clear DOT net DOT nz
> - http://www.geocities.com/siliconvalley/horizon/4532
> ----
Uwe
- Raw text -