Sender: nate AT cartsys DOT com Message-ID: <35A66218.DA27E704@cartsys.com> Date: Fri, 10 Jul 1998 11:48:56 -0700 From: Nate Eldredge MIME-Version: 1.0 To: Stefan Ahl 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> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Precedence: bulk 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