int n;
if ((fp = fopen("student.txt", "a")) == NULL)
{
printf("File open error!\n");
exit(1);
}
fclose(fp);
if ((fp = fopen("student.txt", "r")) == NULL)
{
printf("File open error!\n");
exit(1);
}
p1 = (struct student*)malloc(sizeof(struct student));
p1->next = NULL;
head = p1;
while (!feof(fp))
{
if (fread(p1, sizeof(struct student), 1, fp) != 1)
break;
p2 = (struct student*)malloc(sizeof(struct student));
p2->next = NULL;
p1->next = p2;
p1 = p2;
}
}
这段程序不知道什么用,有人可以看看吗
- 写回答
- 好问题 0 提建议
- 追加酬金
- 关注问题
- 邀请回答
-
3条回答 默认 最新
悬赏问题
- ¥15 hexo+github部署博客
- ¥15 求螺旋焊缝的图像处理
- ¥15 blast算法(相关搜索:数据库)
- ¥15 请问有人会紧聚焦相关的matlab知识嘛?
- ¥15 网络通信安全解决方案
- ¥50 yalmip+Gurobi
- ¥20 win10修改放大文本以及缩放与布局后蓝屏无法正常进入桌面
- ¥15 itunes恢复数据最后一步发生错误
- ¥15 关于#windows#的问题:2024年5月15日的win11更新后资源管理器没有地址栏了顶部的地址栏和文件搜索都消失了
- ¥100 H5网页如何调用微信扫一扫功能?