Is it possible in C++ to serialize an object by taking a pointer of the first address of the object and increment this pointer till the end of the object is reached?
If it’s possible, how can I find the first memory adress of the object and in which data type should I store the values? And how could I build the object on the other side?
This is relatively easy to do in some very restrictive circumstances (POD with no pointers/references; same OS, CPU architecture and the C++ compiler on both ends of the serialization pipe).
There is a number of issues that complicate matters in the more general case:
inton one platform isn’t necessarily the same size asinton another);