0

My program for speller(hashtable) always returns the following:

[1mdictionary.c:35:19:[1m[31m runtime error: [1m[0m[1mmember access within null pointer of type 'node' (aka 'struct node')[1m[0m
[1mdictionary.c:35:12:[1m[31m runtime error: [1m[0m[1mnull pointer passed as argument 1, which is declared to never be null[1m[0m
[1m/usr/include/string.h:122:14:[1m[30m note: [1m[0mnonnull attribute specified here[1m[0m
0

Doesn't look too random to me.

First message indicates you did something like new_node->word or new_node->next, but the new_node (or whatever the variable is) is NULL.

Second message indicates you are passing a NULL to a function that does not like NULL as input, and is guarded with a __THROW __nonnull function attribute.

Third line explains this function is strcpy.

Can't say more without seeing at least some code.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .