/* Structure for a linked list*/
struct list{
   int num;
   struct list* next; /* pointer to next node in list*/
};
/* Function to traverse the linked list given the starting node pointer */
void traverse(struct list* node)
{
   printf(“[%s]\n”,__FUNCTION__);
   while(node != NULL)
   {
      printf(“%d–>”,node->num);
      node = node->next;
   }
   printf(“NULL\n”);
}
/* Function to use the linked list functions*/
int main()
{
   struct list* node = NULL;
   struct list* new = NULL;
   int i;
   for(i=0; i < 10; i++)
   {
      insert(&node,i);
   }
   traverse(node);
}