cvs.gedasymbols.org/archives/browse.cgi   search  
Mail Archives: djgpp/1998/08/01/09:31:04

From: "Böhme Uwe" <uwe AT hof DOT baynet DOT de>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: file problems
Date: Sat, 01 Aug 1998 15:17:05 +0200
Organization: Bingo (Buergernetz Ingolstadt eV)
Lines: 43
Message-ID: <35C31551.456BB29E@hof.baynet.de>
References: <35BEE390 DOT B9DF89E8 AT clear DOT net DOT nz>
NNTP-Posting-Host: port38.hof.baynet.de
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp


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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019