这应该将我的输入保存到另一个 txt 文件中。该程序将询问您的 txt 文件的名称。
FILE *save;
char filename[100];
scanf ("%s", filename);
save = fopen ("filename", "w");
current = head;
while (current != NULL)
{
fprintf (save, " %s %s %d", current -> name, current -> tel, current -> age);
current = current -> next;
}
fclose(save);
有人可以告诉我我的错误吗?