Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Data Bases > Berkely DB > Re: Cannot read...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 2 of 2 Topic 1793 of 1805
Post > Topic >>

Re: Cannot read from database correctly

by Sam <salsubaiee@[EMAIL PROTECTED] > Mar 22, 2008 at 08:20 AM

I know how to fix it now.

instead of

key_1.set_data(&money);
key_1.set_ulen(sizeof(float));

we put:

key_1.set_data(&money);
key_1.set_size(sizeof(float));

and to fix the key printing we need to write:

cout << *((float*)key_1.get_data()) << "\n";

instead of:

cout << key_1.get_data() << "\n";




I hope this help someone else.
 




 2 Posts in Topic:
Cannot read from database correctly
Sam <salsubaiee@[EMAIL  2008-03-19 23:03:14 
Re: Cannot read from database correctly
Sam <salsubaiee@[EMAIL  2008-03-22 08:20:14 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Mon Oct 13 6:49:32 CDT 2008.