Hi,
I have a data structure that looks like this:
struct MY_STRUCT {
int x,y,z;
string str1;
string str2;
vector<floatvfl oats1;
vector<floatvfl oats2;
}
I'm trying to save this structure into a 3rd party file to be read back
later. I was told I could serialize this structure into a stream of
bytes and then dump it into the file.
For this type of stuff I'm used to creating a delimited version of the
struct, using pipes for example:
x|y|z|str1.leng th|str1|str2.le ngth|str2|vfloa ts1.size()|vflo ats1|vfloats2.s ize()|vfloats|
but I'm wondering if there is a simpler way of 'serializing' the
structure into a stream of bytes? Any ideas would be great. I am also
using MFC by the way, I see they have their own serialization scheme,
that is also a possibility for me to take advantage of,
Thanks
I have a data structure that looks like this:
struct MY_STRUCT {
int x,y,z;
string str1;
string str2;
vector<floatvfl oats1;
vector<floatvfl oats2;
}
I'm trying to save this structure into a 3rd party file to be read back
later. I was told I could serialize this structure into a stream of
bytes and then dump it into the file.
For this type of stuff I'm used to creating a delimited version of the
struct, using pipes for example:
x|y|z|str1.leng th|str1|str2.le ngth|str2|vfloa ts1.size()|vflo ats1|vfloats2.s ize()|vfloats|
but I'm wondering if there is a simpler way of 'serializing' the
structure into a stream of bytes? Any ideas would be great. I am also
using MFC by the way, I see they have their own serialization scheme,
that is also a possibility for me to take advantage of,
Thanks
Comment