title: How to compare two strings for a binary search tree
body: <p>I am trying to compare two strings to see where it should go as a leaf node from the root and so fourth. I keep trying to use string compare and I get an error. I am very unfamiliar with binary trees in c and need help inserting nodes.</p>
  
  <p>Here is the code I have so far that is giving me an error:</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  #define MAXLEN 15
  
  typedef struct treeNode{
    char string[MAXLEN+1];
    struct treeNode *left;
    struct treNode *right;
  }treeNode;
  
  treeNode * insert(treeNode *node, char s[MAXLEN+1]){
    if(node == NULL){
      treeNode *temp;
      temp = (treeNode *)malloc(sizeof(treeNode));
      strncpy(temp -&gt; string, s, sizeof(treeNode));
      temp -&gt; left = NULL;
      temp -&gt; right = NULL;
      return temp;
    }
  
    else-if(strcmp(node-&gt;string,char s)&gt;0){
  
    }
  }
  </code></pre>