Thanks for the debugs, but the problem is still persisting. 23rd loop through, the test printf gets to #, and windows informs me that the program is attempting to write to NULL.
Which, I guess, means that the in-code comment in the code is probably at the wrong place. The error, 23rd time around, somewhere around here:
Code:
//Is a code fragment. Full program attached to first post.
printf("#"); //test printf
value = hash(readin);
count = 0;
while(htable[value] != NULL)
{
value = (value + 1) % TABLESIZE;
count++;
if(count >= TABLESIZE - 1)
{
printf("Table is Full\n");
return;
}
printf("$"); //test printf
}
htable[value] = malloc(sizeof(strlen(readin))+1);
if(htable[value] == NULL)
{
fprintf(stderr, "Out of Memory");
iexit(htable, 0);
}
printf("%%"); //test printf
If the Hash table were full (and my code to check that it's full is working), it should just exit back to main, print out that the table is full, then go on. It's not done that. I even know that the linear probing works properly as the sequence of the test printfs is as follows:
!@#%^#%^#%^#%^#%^#%^#%^#$%^#%^#%^#%^#%^#%^#%^#%^#%^#%^#%^#%^#%^#%^#%^#
The $ sign there shows that it's gone through the stepping at least once.
This is really frustrating!