Everything loads in the list fine but inside the loop to add the words to the tree inside the list the root is always returned as null when trying to print. I'm using a standard insert and I don't see any pointing problems even though from the output that is most likely what it is. Any help at "pointing" out my blind spots would be appreciated. The pun is stupid, I'm drunk on programming.Code:struct t_node { char word[20]; int wordAppears; struct t_node *left; struct t_node *right; }; typedef struct t_node TREE_NODE; struct t_tree { TREE_NODE *root; }; typedef struct t_tree TREE; struct node { char title[50]; int height, wordsInTree; TREE *tree; struct node *next; }; typedef struct node LIST_NODE; struct list { LIST_NODE *head; }; typedef struct list LIST; TREE_NODE *addTreeNode(char *string, TREE_NODE *pCurrent) { if(pCurrent == NULL) //if the root doesn't exist yet { pCurrent = (TREE_NODE *)(malloc(sizeof(TREE_NODE))); //create new node pCurrent->wordAppears = 0; pCurrent->left = NULL; pCurrent->right = NULL; strcpy(pCurrent->word, string); } else if(strcmp(string, pCurrent->word) < 0) //word is smaller, send left addTreeNode(string, pCurrent->left); else if(strcmp(string, pCurrent->word) > 0) addTreeNode(string, pCurrent->right); else //we have a match and we should increment the word counter pCurrent->wordAppears++; return pCurrent; } void loadData(FILE *file, LIST *chapters) { LIST_NODE *currentChapter; int totalChapters = 0; int i = 0; int wordsInTree = 0; char word[20]; fscanf(file, "%d\n", &totalChapters); currentChapter = chapters->head; //initialize outside loop while(i < totalChapters) { if(currentChapter == NULL) //this is the first chapter { currentChapter = (LIST_NODE *)(malloc(sizeof(LIST_NODE))); currentChapter->tree = NULL; currentChapter->wordsInTree = 0; currentChapter->height = 0; } //create the tree currentChapter->tree = (TREE *)(malloc(sizeof(TREE))); currentChapter->tree->root = NULL; //read title and the number of words in the file fscanf(file, "%s %d", ¤tChapter->title, ¤tChapter->wordsInTree); wordsInTree = currentChapter->wordsInTree; //currentChapter->height = heightOfTree(currentChapter->wordsInTree); //fill the tree while(wordsInTree > 0) { fscanf(file, "%s", &word); //printf("%s\n", word); addTreeNode(word, currentChapter->tree->root); wordsInTree--; } if(i == 0) chapters->head = currentChapter; //fill head node currentChapter->next = (LIST_NODE *)(malloc(sizeof(LIST_NODE))); currentChapter = currentChapter->next; //move to next node i++; } //printf("%s\n", chapters->head->height); /*printf("%s\n", chapters->head->next->title); printf("%s\n", chapters->head->next->next->title); printf("%s\n", chapters->head->next->next->next->title);*/ }