struct Elem {
   int data;
   struct Elem* next;
};

int main () {
   struct Elem* list;
   struct Elem* aux;

   list = new Elem;
   list->data = 1;

   list->next = new Elem;
   list->next->data = 2;

   list->next->next = new Elem;
   list->next->next->data = 3;

   list->next->next->next = new Elem;
   list->next->next->next->data = 4;
   list->next->next->next->next = 0;

   aux = list;
   
   // Break and continue till the next line
   // Display "list" and "aux", and unreference "list" as long as "next" is
   // not 0x0.
   // Dereference "aux", and press "next" until the end of the loop. At each
   // stop, unreference aux.
   //
   // The links between aux and the various elements of the list were not
   // removed when updating.
   
   while (aux) {
      aux = aux->next;
   }
}
	
