Next The Identity Function 15

Dynamic Allocation

        node * insert_node (node **head, void*data) 
        {
          node *newnode = malloc(sizeof(node));
          if (newnode == 0) return 0;
          newnode->data = data;
          newnode->next = *head;
          *head = newnode;
          return newnode;
        }


Next Copyright © 2001 M. J. Dominus