/* Copyright (c) 2001-2004 by SoftIntegration, Inc. All Rights Reserved */
#include "list.h"

int main() {
  class List students;

  int i;
  struct Data data1, data2, data3, data4;

  /* prepare the data */
  createData(&data1, 456, "Mary");
  createData(&data2, 789, "John");
  createData(&data3, 234, "Peter");
  createData(&data4, 567, "Hanson");
  students.prepend(data1);
  students.prepend(data2);
  students.append(data3);
  students.insert(data4, 2);

  students.printList();
  students.printName("Peter");

  i = students.printName("Bob");
  cout << "There is/are " << i << " person(s) named Bob" << endl; 

  students.removeElement(789);
  students.printList();
  students.printName("Peter");

  students.clear();
  students.printList();

  freeMem(&data1);
  freeMem(&data2);
  freeMem(&data3);
  freeMem(&data4);
  return 0;
}
