title: C: Help understanding pointers
body: <p>I have been building this hash table function that is given an array it gets a word from and a pointer to an array that it fills with my linked list struct. It compiles correctly but I get a segmentation fault at - *hashTable[hashVal] = *newNode; .</p>
  
  <pre><code>void hashTableCreate(char *array, list *hashTable[]) {
  
  while(arrayPos &lt; getArrayLength(array)) {
  
      char *temp = getWord(array);
      int hashVal = hashingFunc(temp);
      if((*hashTable[hashVal]).word == temp ) {
          (*hashTable[hashVal]).count = (*hashTable[hashVal]).count+1;
      }
      else {
          list *newNode = malloc(sizeof(list));
          strcpy(newNode-&gt;word,temp);
          newNode-&gt;count = 1;
          *hashTable[hashVal] = *newNode;
      }
  }
  }
  </code></pre>
  
  <p>It's called like this:</p>
  
  <pre><code>void timeStructures(char *newArray) {
      list *hashTable[3000];
      hashTableCreate(newArray, hashTable);
  }
  </code></pre>
  
  <p>I know this is to do with the way I am using my pointers but I can't figure it out. Any help would be appreciated.</p>