My size function is not working and I don't understand why
unsigned int size(void)
{
int c = 0;
for (int i = 0; i < N; i++)
{
node *wNode = table[i];
while (wNode->next != NULL)
{
c++;
wNode = wNode->next;
}
}
return c;
}
I have looked over at similar size function which is quite similar to my design, but it still is not working.
Don't hesitate to ask me for other functions, I can provide those too! But the errors only come from this function.
EDIT: Thanks to the kind person for helping me figure this out
if (wNode != NULL)
{
c++;
while (wNode->next != NULL)
{
c++;
wNode = wNode->next;
}
}