Original Post
I've been using read and write on fstream, but have been told there could be trouble with alignment on different platforms.. so if I write the data on my windows computer using fstream or in a maxscript that exports my model and then want to load it on a different platform I might get into trouble when I load it.. How do you solve this? I guess I could use formated io and the io operators, but this is slower and would take up more disk space..
Writing on platform1
Reading on platform2, the data might not be correct due to alignment..
Writing on platform1
float array[2] = {42.0, 42.0}
filestream.write(reinterpret_cast<char*>(array), sizeof(float) * 2);
Reading on platform2, the data might not be correct due to alignment..
float array[2];
filestream.read(reinterpret_cast<char*>(array), sizeof(float) * 2);