Warren Young wrote:
> Ankur G35 Saxena wrote:
>> Hi, I wanted to read and write a C++ structure to the DB.
>
> Bad, bad idea. For this to be guaranteed to work, you could never
> upgrade your compiler version or change compilers. You can't even
> change some compiler options even if you were willing to stick with a
> single compiler, because there are options that will change the binary
> layout of your classes.
>
> Do a Google search for object serialization in C++. There are ways to
> get around this problem, many of which will solve the BLOB problem as
> a side effect.
>
I can recommend ICE. I have successfully used ICE by ZeroC to
serialize/de-serialize to/from MySql Blob fields using (interchangeably)
multiple C++ compilers and C#.
> Or, switch to a language that understands things like serialization
> and reflection. This is one of the things that C++ is just not good at.
>