1
0
mirror of https://github.com/renbaoshuo/202401-programming-assignments.git synced 2024-12-16 15:44:39 +00:00
202401-programming-assignments/【实践课内】15.结构体1/6-2 结构体数组中查找指定编号人员.c

13 lines
262 B
C

struct student fun(struct student *std, char *num) {
struct student res = {"\0", 0, 0, 0};
for (int i = 0; i < N; i++) {
if (strcmp(std[i].num, num) == 0) {
res = std[i];
break;
}
}
return res;
}