Re: HELP: Class object I/O
From: klaas (jan_at_zonnet.ru)
Date: 10/09/03
- Next message: Rob Williscroft: "Re: help in inheritance and typedef"
- Previous message: kanze_at_gabi-soft.fr: "Re: unget vs. putback"
- In reply to: klaas: "Re: HELP: Class object I/O"
- Next in thread: Moonlit: "Re: Class object I/O"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Thu, 09 Oct 2003 22:15:52 +0200
klaas wrote:
> Andreas Palsgård wrote:
>
>> Hey.. i want to write a class object containing both strings and
>> integers,
>> to a file on disk, and be able to read it properly again at another
>> time. I
>> made the code below... it doesn't work, but what am i doing wrong.
>>
> the problem is:
> you don't know the size of the data you are writing to the file in advance.
> You have to make any char * into a char[fixed_size]
> to be able to let any size_of(your_object) return a descent value.
> that way your reinterpret_cast<hex> won't fail....
>
> so no char * pointers please...
>
If you have the fixed size issue ready i can give you a wrapper class
that implement harddisk based arrays...
let me know
- Next message: Rob Williscroft: "Re: help in inheritance and typedef"
- Previous message: kanze_at_gabi-soft.fr: "Re: unget vs. putback"
- In reply to: klaas: "Re: HELP: Class object I/O"
- Next in thread: Moonlit: "Re: Class object I/O"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|