can somebody help me with serialization of this simple class in C++:
class State {
public:
int count;
Point point;
double angle;
Point* possible;
int possibleSize;
Line line;
list<Point> route;
State() {
}
~State() {
delete[] possible;
}
};
// --- Structures
// Line structure (ax + by + c = 0)
struct Line {
int a;
int b;
int c;
};
// Point structure
struct Point {
int x;
int y;
};
I can't use any 3rd party classes or libraries and I need to serialize this into byte array (or string). Can somebody write how? I just don't know how to start.
Thanks a lot.