On 8 December 2015 at 23:18, Martin Vymazal <martin.vymazal@vki.ac.be> wrote:
On 2015-12-08 22:48, Maarten de Vries wrote:
Of course, not relying on the platform specific bit representation of
primitive data types when serializing data is a much better idea.

-- Maarten

What would be a possible approach to save the data without 'relying on the platform specific bit representation of primitive data types' as you put it? I can not save the data as plain ascii text, because the files would simply be huge (the're already big as they are). Is there some more intelligent solution? I'm not a software engineer, so I'd be happy to hear what is the common practice here.

Martin


If you're interested:

You can still use a binary format, though it depends on your needs. You could look at boost serialization [1]. I've never worked with it, so I can't comment on performance (either in terms of speed or serialized size). But in theory it solves the problem of saving and loading data to/from files (and more).

Another option might be Binn [2]. It's C but it looks simple and clean enough (although I also never worked with it).