This prints out 2 and 3, however I am not incrementing curr by an incremental operator (curr++). I was under the impression that I would need an incremental operator to make curr point to the next appropriate address (which is tail). Shouldn't the output be 2 every time.
How does it magically know to move to the tail address without an explicit instruction to do so.
All three nodes head, first and tail are already linked together via the pointer next.
head's next points to first
first'next points to tail
tail'next points to NULL (thus ends).
So by using curr = curr->next;, you get the drill.
Also, by setting a pointer to NULL doesn't mean it points to nothing, it will point to an arbitrarily number that is safe when accidentally messed with.