I\'m devising a file format for my application, and I\'d obviously like for it to work on both big-endian and little-endian systems. I\'ve already found working solutions fo
XML is probably the most portable way to do it.
However, it appears that you already have most of the parser built, but are stuck on the float/double issue. I would suggest writing it out as a string (to whatever precision you desire) and then reading that back in.
Unless all your target platforms use IEEE-754 floats (and doubles), no byte-swapping tricks will work for you.