Okay so I am creating a Binary Search Tree that reads in strings and stores them in the tree. I am trying to confirm that each string has it's own node and each string is actually being read in. When my program is run, I believe it is creating seven nodes, one for each of the strings in the input file. So I created an Output file that prints the string that was just read to make sure each string is being stored in a node. There are seven strings in my input file :

```
bring
awake
anger
carry
global
fixed
halt

```

Here is the code for my program: 

```
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define MAXLEN 15

typedef struct treeNode{
  char string[MAXLEN+1];
  struct treeNode *left;
  struct treeNode *right;
}treeNode;

treeNode * insert(treeNode *node, char s[MAXLEN]){
  puts("running insert");
  if(node == NULL){
    node = (treeNode *)malloc(sizeof(treeNode));
    strncpy(node -> string, s, MAXLEN);
    node -> left = NULL;
    node -> right = NULL;
  }

  else if(strcmp(node->string, s)>0){
    node -> right = insert(node->right, s);
  }
  else if(strcmp(node->string, s)<0){
    node -> left = insert(node->left, s);
  }
  else if(strcmp(node->string, s) == 0){
    node -> left = insert(node->left, s);
  }

  return node;

}

int main(int argc, char *argv[]){

  treeNode *root = NULL;

  FILE *ifp;
  FILE *ofp;
  char s[MAXLEN+1];

  if(argc != 3){
    fprintf(stderr, "Usage: %s file\n", argv[1]); exit(1);
  }

  if((ifp = fopen(argv[2], "r")) == NULL){
    fprintf(stderr, "Could not open file: %s\n", argv[2]); exit(1);
  }

  ofp = fopen("output.txt", "w+");

  while(fscanf(ifp, "%s\n", &s) != EOF){
    root = insert(root, s);
    fprintf(ofp, "%s\n", root->string);
  }
  return 0;
}

```

And this is what the output file looks like after running the program:

```
bring
bring
bring
bring
bring
bring
bring

```

Now there are seven strings in each file so i am assuming each one is read. But how can I know if my program successfully created a node for each string?
How can I fix the problem? Any help would be appreciated! Thanks!