Node *runner = table[location];
runner = runner->next;
if(runner == NULL )
You have never checked if table[location]null is. But during the construction of your hash table, there are no nodes inside the node table (you set each record to zero).
The problem with your code is that you never think about node allocation. You have to do
Node* toInsert = new Node;
toInsert->next= NULL;
toInsert->num = num;
if(table[location]==NULL){
table[location] = toInsert;
}
else{
Node *runner = table[location];
while(runner->next != NULL){
runner = runner->next;
}
runner->next = toInsert;
}
source
share