void save(FILE *stream, stuPtr p, size_t len)
{
if (len <= 0)
{
printf("\a\n\n\t\tSorry: No data exist!\n");
sleep(2);
return;
}
else
{
unsigned count = 0;
fprintf(stream, " ID Name Score\n");
fprintf(stream, " -------------------------------------------------\n");
for (unsigned i=0; i<len; i++)
{
fprintf(stream, "%3d-", ++count);
fprintf(stream, " %s\t\t", p[i].stuID);
fprintf(stream, " %s\t\t", p[i].stuName);
fprintf(stream, " %.2lf\n", p[i].stuScore);
}
fprintf(stream,"\n -------------------------------------------------\n");
printf("\a\n\n\tSave successfully!\n\n");
}
}
线性表的基本操作及其作用(5)
内容版权声明:除非注明,否则皆为本站原创文章。
转载注明出处:https://www.heiqu.com/7ca662d14e75958835d7f0278c61c975.html