Misleading Code Sample in Getting Started Guide -
03-21-2006
, 07:15 AM
Hi,
From:
http://www.sleepycat.com/docs/gsg/C/...eDatabaseRead:
------------
/* Database open omitted for clarity */
money = 122.45;
/* Zero out the DBTs before using them. */
memset(&key, 0, sizeof(DBT));
memset(&data, 0, sizeof(DBT));
/*
* Use our own memory to retrieve the float.
* For data alignment purposes.
*/
key.data = &money;
key.ulen = sizeof(float);
key.flags = DB_DBT_USERMEM;
------------
The above doesn't work. s/key.ulen/key.size/ fixed it.
Thanks,
Mohammed Firdaus |