title: How Can I Search A Word in A Binary Search Tree?
body: <p>I want to search a word in a binary search tree. This is my code . But it has run time error .</p>
  
  <pre><code>struct node {
  int id;
  char text[100];
  strcut node *right;
  struct node *left;
  }
  
  
  int main(){
  
  // reading fles from the folder. The folder's name is Texts .
  if(( dir = opendir("C:\\Texts\\")) != NULL ){ 
  while((ent = readdir(dir)) != NULL ){ 
  char k[100],l[100],*w; 
  char b[100]; 
  char a[100]="C:\\Texts\\"; 
  strcpy(b,folder-&gt;d_name); 
  file=fopen((strcat(a,b)),"r"); 
  while(!feof(file)){ 
  fgets(l,sizeof(l),file); 
  printf("%s",l); }
  }
  void listWord(node *tree,char word[]){
  node * g, * h;
  g=tree;
      if(g==NULL ){
      printf("list is empty");
      }
      else{
           while(g!=NULL){
              if(strstr(g-&gt;text,word)!=NULL){
              printf(" specific word %s: \n",word);
              printf("\n\t\t  id is :%d ",g-&gt;id);
          }
       listWord(g-&gt;left,word);
       listWord(g-&gt;right,word);
      }
  }
  </code></pre>
  
  <p>it doesn't work :/ How can I fix it ? 
  P.S : word is given frm user and struct node tree has left, right, id ,text .</p>