Difference between linked list traversal **while(thead != NULL)** and while(thead->next !=NULL)
问题 Can anyone tell me what is the difference between while(thead != NULL) and while(thead->next !=NULL) because for traversing the list thead != NULL is not working while thead->next works. According to my understanding head node is just a pointer to the starting node and not the the starting node itself. See this if u have doubt.Here head just stores address. //thead means temp head variable to store the address head points to. This is the code for insertion. #include<stdio.h> #include<malloc.h