CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    May 1999
    Location
    New Delhi, India
    Posts
    359

    How to make a linked list of pointers to CRecordset Object

    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?

    Whenever I hear "It can't be done", I know, I am close to success!!

  2. #2
    Join Date
    May 1999
    Posts
    13

    Re: How to make a linked list of pointers to CRecordset Object

    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured