From: Warren Young Date: September 26 2006 7:36am Subject: Re: Reading Writting BLOB VARBINARY Q. List-Archive: http://lists.mysql.com/plusplus/5964 Message-Id: <4518D882.3010604@etr-usa.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit 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. 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.