www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/07/10/15:05:10

Sender: nate AT cartsys DOT com
Message-ID: <35A66218.DA27E704@cartsys.com>
Date: Fri, 10 Jul 1998 11:48:56 -0700
From: Nate Eldredge <nate AT cartsys DOT com>
MIME-Version: 1.0
To: Stefan Ahl <ahl AT inf DOT fu-berlin DOT de>
CC: djgpp AT delorie DOT com
Subject: Re: store/get objects via fstreams with DJGPP C++
References: <35A4D7D4 DOT 134230D7 AT inf DOT fu-berlin DOT de>

Stefan Ahl wrote:
> 
> Hi,
> 
> I am a beginner in daily C++ programming.
> My OO experience is build on Java.
> Now I try to serialize objects within a way I have read
> in the book 'C++ in 21 days'.
> 
> Imagine You have an object of type person and You want
> to store it on disk. You should be able to do that like this:
[snipped] 
> That is the description of the said book.
> But it does not work that way. The ofstream is not able to write
> an object to a file.

Shot in the dark:  Are you using the latest version of GCC/libstdc++?
(2.8.1)  The old 2.7.x versions had a bug in the C++ library where (I
seem to recall) binary opens of streams would be done wrong.
-- 

Nate Eldredge
nate AT cartsys DOT com

- Raw text -


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