Google Answers Logo
View Question
 
Q: C programming question .. will pay more for completion ( No Answer,   0 Comments )
Question  
Subject: C programming question .. will pay more for completion
Category: Computers > Programming
Asked by: datapro-ga
List Price: $8.00
Posted: 10 Mar 2003 14:02 PST
Expires: 09 Apr 2003 15:02 PDT
Question ID: 174321
How to write data in memory and from memory  to .bin file

I need to write a program that create a database (create table/ drop
table etc.) in c. I have done most of it. But still need to write
couple of more functions.

If any body can help I will give my code?
I am willing to pay more if the program works.

Request for Question Clarification by maniac-ga on 10 Mar 2003 17:00 PST
Hello Datapro,

The answer will depend on the system you are using. Is it
 - Unix or Linux
 - Microsoft Windows
 - or something else?
I also assume the ".bin" file is to have an exact image of the data in
memory. If not true, please explain the format to be used.

Thanks.
  --Maniac

Clarification of Question by datapro-ga on 10 Mar 2003 17:37 PST
It's in wondows system. Yes; it's exact image.

If you post your phone number, I can call you back.

Request for Question Clarification by blader-ga on 11 Mar 2003 19:20 PST
How is your data stored in memory?

Clarification of Question by datapro-ga on 16 Mar 2003 14:36 PST
Need an expert in C.

My "create table"  part is working. But the "drop table"/"create
index"
is not  working.

A list structure in memory contains table, column, index(if any)
So the size for the list is size of(table + column + index + list
itself)

For exam:

list:(tab1+columnfortab1)(tab2+columnfortab2+indexfortab2)(tab3columnfortab3)

DROP TABLE: 
Let, I need to drop from this list tab2. So 1st I need to drop the
index for tab2, then the tab2 and the column of it.

Have a method that returns a pointer to the table we want to drop
 
Need to use memcpy() to copy data in the list in memory

-Need to allocate space for (old_list - size of(tab2)).
-Save the part of the list we need in tmp list,
-then copy tmp in the original list.

The new list would be after the drop of tab2
list:(tab1+columnfortab1)(tab3columnfortab3)

CREATE INDEX:
Let,  now we want to create an index for tab3
Need to allocate space for (old_list + size of(the index))

use memcpy() to copy index in the list in memory

The new list would be after creating index on tab3
list:(tab1+columnfortab1)(tab3+columnfortab3+indexfortab3)

DROP INDEX:
Like DROP TABLE.

All we need to calculate the right memory space to add and delete
data.

I think my calculation is not correct, that's why its not working.
Answer  
There is no answer at this time.

Comments  
There are no comments at this time.

Important Disclaimer: Answers and comments provided on Google Answers are general information, and are not intended to substitute for informed professional medical, psychiatric, psychological, tax, legal, investment, accounting, or other professional advice. Google does not endorse, and expressly disclaims liability for any product, manufacturer, distributor, service or service provider mentioned or any opinion expressed in answers or comments. Please read carefully the Google Answers Terms of Service.

If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you.
Search Google Answers for
Google Answers  


Google Home - Answers FAQ - Terms of Service - Privacy Policy