Serializing object to byte-array in C++
I am working on an embedded device (microcontroller), and I want to save objects to permanent storage (an EEPROM). Most of the serialization solutions I can find, use the file-system in some way, but my target has no file-system. Therefore my question is, how can I serialize an object to a byte-array so I can save that byte-array to an EEPROM afterwards? Here is an example of what i am trying to do: class Person{ //Constructor, getters and setters are omitted void save(){ char buffer[sizeof(Person)]; serialize(buffer); EEPROM::Save(buffer, sizeof(Person)); } void load(){ char buffer[sizeof