Hello
I am trying to create a linked list of the following style:
Basically, a pointer to an object and a pointer to the next node of the list. Is this the correct way of doing it?Code:#include "variable.h" // CLASS called variable struct node{ variable *objectPtr; struct node *next; }; typedef struct node nodeptr;
I'm not sure how to set and access the object either. So far I have been trying this but it has not worked
Code:ptr->objectPtr = new variable(VarID,constant);Thanks for helpCode:cout << (ptr->objectPtr).GetVarID() << endl; //GetVarID() is a member function



LinkBack URL
About LinkBacks


