I have a structure which I made into a binary search tree. It reads each word from a file and inserts into tree.
Now I am trying to implement a linked list to hold the offsets for a word each time it is in the file.
I am having trouble adding a linked list inside a structure and cannot seem to find any references. Could someone point me in the right direction? Here is my attmept:
would something like this not work?Code:struct test{ long off; struct test *next; }; //basic structure to hold abstract search words struct words{ char word[51]; //data word int count; //counter for reoccurences struct words * left; //left child node struct words * right; //right child node struct test * temp; }; typedef struct words * RECPTR; RECPTR->temp->off = ftell(fp);