This cannot work as void
does not contain any member next
.
You must use your node structure struct tmpList *
to access any members.
Functions dealing with list manipulation should use the prope node type in the signature to get some type safety.
If you really want to use void *
in the signature, you must cast the pointer to (struct tmpList *)
inside your function.
Otherwise you will not be able to access members.
solved void struct linked list [closed]