On Wed, Dec 07, 2005 at 08:49:42PM +0100, [EMAIL PROTECTED] wrote:
> Hello,
> I have a following problem.
> In my program I have a vector of elements let say defined as follow:
> 
> struct intDouble {
>   int x;
>   int y; 
> };

It's pretty straightforward, presuming you've already figured out the
basics of connecting to the database.  You need to use 'blobs', which
are traditionally Binary Large Objects, but they can easily be small
objects as well.  Check out the documentation for:
http://www.sqlite.org/capi3ref.html#sqlite3_bind_blob and
http://www.sqlite.org/capi3ref.html#sqlite3_result_blob

To make it work in more than a superficial manner, you probably will
need a good understanding of how structures are internally represented
in C++ or C.  You pass sqlite a pointer to the struct and tell it how
long it is (using sizeof()).  When you get the blob back, you then
treat the data as an instance of your structure by casting it.

I'm not sure what level you are asking this question at, so I'm not
sure how to respond.  More background information would be helpful.

Good luck!

--nate

Reply via email to