void findEmployeeByID(int id, const char filename) {
FILE file = fopen(filename, “rb”);
Employee emp;
int found = 0;
while (fread(&emp, sizeof(Employee), 1, file)) {
if (emp.employeeID == id) {
printf("找到员工:%s, 部门:%s\n", emp.name, emp.department);
found = 1;
break;
}
}
fclose(file);
if (!found) {
printf("未找到ID为 %d 的员工!\n", id);
}
}
利唐i人事HR社区,发布者:ihreditor,转转请注明出处:https://www.ihr360.com/hrnews/20241253161.html