home *** CD-ROM | disk | FTP | other *** search
/ World of Shareware - Software Farm 2 / wosw_2.zip / wosw_2 / CPROG / CPTUTOR2.ZIP / ELEMLIST.CPP < prev    next >
Text File  |  1990-07-20  |  585b  |  34 lines

  1.                                     // Chapter 11 - Program 7
  2. #include "elemlist.hpp"
  3.  
  4.  
  5.  
  6. void
  7. employee_list::add_person(person *new_employee)
  8. {
  9. employee_element *temp;
  10.  
  11.    temp = new employee_element(new_employee);
  12.    if (start == NULL)
  13.       start = end_of_list = temp;
  14.    else {
  15.       end_of_list->next_employee = temp;
  16.       end_of_list = temp;
  17.    }
  18. }
  19.  
  20.  
  21.  
  22.  
  23. void
  24. employee_list::display_list(void)
  25. {
  26. employee_element *temp;
  27.  
  28.    temp = start;
  29.    do {
  30.       temp->employee_data->display();
  31.       temp = temp->next_employee;
  32.    } while (temp != NULL);
  33. }
  34.