Just look at all of the interactions your program has with 'head'. It is first assigned a value of NULL then it is never assigned anything again. So when you call "traverse()" 'temp' copies 'head' (which was never assigned anything but NULL) and your for loop evaluates but never executes.