热门

最新

红包

立Flag

投票

同城

我的

发布
mooreyang
MooreYang
5 年前
truemooreyang

calloc、realloc、malloc

CSDN App 扫码分享
分享
评论
2
打赏
  • 复制链接
  • 举报
下一条:
谁看的懂写的是什么意思,会解释吗?求助FILE* ft = fopen(filename, "r"); // 加总加分名单中 name格式正确的人的答题次数char data[STR];if (list != NULL){while (fscanf(ft, "%s", data) == 1) {// 检查读取的文件行是否有效if (data == NULL) {printf("\n\n\t\t\t\t未检测到有效数据哦!\n\n\n");system("pause");MainMenu(list);} //遍历链表进行加分int len = LenLinkList(list);Student* current = (Student*)malloc(sizeof(Student));if (current) {current = list->head;for (int i = 0; i <= len; i++) {if (strstr(data, current->name) != NULL) {current->score++;}current = current->next;}}}}
立即登录