Data Abstraction: Another Example
struct employee_info employees[MAX_EMPLOYEES];
void add_employee(char *name, int pay)
employees[num_employees].name = strdup(name);
employees[num_employees].base_pay = pay;
employees[num_employees].year_started = curr_year();
employees[num_employees].leave_time = 0;
add_employee(“John”, 20000);
add_employee(“Jill”, 30000);
add_employee(“Mary”, 40000);
printf(“Something’s wrong!\n”);
for (i = 0; i < num_employees; i++)