previous | index | next

Defining a Simple list Type

Since a list is made out of items, define a struct called listItem where:
  struct listItem {
      int item;         // like the CAR of a list
      listItem* rest;   // like the CDR of a list
  };
Since a pointer to a list item gives you access to the whole list behind it, call a pointer to a list item a list:
  typedef listItem* list;

previous | index | next