#include <stdio.h>
#include <stdlib.h>

struct list
{
 int data;
 struct list* next;
};
typedef struct list node;
typedef node* Nptr;

int main(void)
{
 int i;
 int length = 3;
 Nptr temp, head;

 head=(node*)malloc(sizeof(node));
 temp=head;

 for(i=0; i<length; i++)
 {
  temp->>  if(i==length-1)
   temp->next=NULL;
  else
   temp->next=(node*)malloc(sizeof(node));

  temp = temp->next;
 }
 return 0;
}

<헤더파일>
#include <stdio.h>
#include <stdlib.h>

typedef char data;

struct linked_list {
 data d;
 struct linked_list *next;
};

typedef struct linked_list element;
typedef element *LINK;