elemlist.cpp

来自「Since the field of object oriented progr」· C++ 代码 · 共 42 行

CPP
42
字号
                             // Chapter 11 - Program 7 - ELEMLIST.CPP
#include <stdlib.h>
#include "elemlist.h"


void
employee_list::add_person(person *new_employee)
{
employee_element *temp;

   temp = new employee_element(new_employee);
   if (temp == NULL)
   {
      exit (1);
   }
   if (start == NULL)
   {
      start = end_of_list = temp;
   }
   else 
   {
      end_of_list->next_employee = temp;
      end_of_list = temp;
   }
}




void
employee_list::display_list(void)
{
employee_element *temp;

   temp = start;
   do 
   {
      temp->employee_data->display();
      temp = temp->next_employee;
   } while (temp != NULL);
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?