Original Post
Hello, A few questions about saving and restoring data in a cross platform application: Say I have a written a cross platform application - say PC and Mac - and I want to be able to save some status of my program (not necessarily a game) on the PC and then load the same information back into the program on a Mac (or maybe another PC). Question 1: What about integer size in bytes? For example, what if on the PC my integer size is 4 bytes, and on the Mac its 2 bytes. How do I handle that? How do I guarantee byte size over different platforms? Question 2: Is endianess a problem with floating point types? Question 3: Is there a technique of saving my data in some sort of custom file format that makes resolving these issues easier? I've been searching the internet, but I have not really found anything helpful, so I'm not sure if these questions are silly or not and I'm just misunderstanding the whole problem :) If someone could enlighten me that would be great. metrix