Code:
#include <stdio.h> /* for printf */
#include <stdlib.h> /* for malloc */
#include <string.h>
struct node
{
char *data;
struct node *next; /* pointer to next element in list */
};
struct node *list_add(struct node **p, char *i)
{
struct node *n = (node *)malloc(sizeof(struct node));
if (n == NULL)
return NULL;