Re:The 5-minute Guide to C Pointers
by RegEx on Thursday August 16, 2012 @02:32AM
(#4390169)
I experienced the same frustration. The exercise that gave me the "ah-ha!" moment I needed was prepending to a linked list via the head instead of the tail: You need to pass the address of `head` into the function so that the new head is reflected in the calling environment when you say `head = np`.
[ Parent
| on HN ]
... or have the list operation return the new list head, which can make it way cleaner. See glib's list APIs, for instance.