Click to See Complete Forum and Search --> : How to make a linked list of pointers to CRecordset Object


pranay
May 7th, 1999, 02:07 PM
I have a class derived from CRecordset( Oracle database).I post some other member functions.I allocate memory for the object say , X on the heap.I make a linked list of the pointer to my object. When i print the values of the members of the object X,using the items in the linked list ,i get the values w.r.t the last inserted element of the linked list. I want to store the pointer( so that i save memory) in the list so that i get the values of the members Rowwise as in the database.How to attack the problem?

davidramsey
May 8th, 1999, 12:11 PM
How are you making the linked list? Is it something to the effect

struct node
{
CRecordset *set;
node *prev;
node *next;
};

With this structure or something similar you should be able to traverse the list that you put into memory.

You will probably want to keep a couple of variables to do so. Something like

struct node *first;
struct node *last;
struct node *current;

Also, don't forget to allocate the memory for each node before trying to use it.

I hope that I understood your question correctly.


TKE Dave