title: Segmentation Fault with Hash Tables
body: <p>I am trying to create a hash table, an array of linked lists more accurately, I have used the add function for the linked list and works perfectly but when trying this for the hash table it produces a segmentation error.</p>
  
  <pre><code>void create_HTable(FILE* book, list* hashTable[1009])
  {
    char word[20];
    read(word,book);
    while(strcmp(word,"EOF")!=0)
    {
      int hash_number = hash(word,1009);
      list* node = hashTable[hash_number];
      node = add(node,word);
      read(word, book);
    }
  }
  
  list *add(list *old_list, char new_word[20])
  {
    //this is a special case when the head of the list is empty
    if(old_list==NULL)
    {
      return insert(new_word,NULL);
    }
    else
    {
      list *new_list = old_list;
      if (doesExist(new_list, new_word, true) == 0)
      {
        while (new_list-&gt;next !=NULL)
        {
          new_list = new_list-&gt;next;
        }
        new_list-&gt;next=insert(new_word,NULL);
      }
      return old_list;
    }
  }
  </code></pre>
  
  <p>this works for a normal linked list but when I try to reuse this in my hash table function it crashes.</p>