int main(int argc, char *argv[]) { /* declare the employees variable, holds all the information * using an array of pointers because its MUCH smaller than an array * of structs. 's' is used in testing malloc */ struct employee *employees[50], *s; int i = 0; bzero(employees, sizeof(struct employee) * 50); for(i = 0; i <= 50; i++) { if((s = malloc(sizeof(struct employee *))) == NULL) { printf("Could not allocate memory!\n"); } else { employees[i] = malloc(sizeof(struct employee)); } } load_employee_info(employees); for(i = 0; i < 6; i++) { employees[i]->gross_pay = get_pay(employees[i]->pay_rate, employees[i]->hours_worked); printf("%s: %.2lf\n", employees[i]->f_name, employees[i]->gross_pay); } /* free() things up now! */ for(i = 0; i < 6; i++) { free(employees[i]); } return 0; }