所以我从另一篇文章中尝试制作此代码:
while(fscanf(orderFile," %49[^;];%d; %49[^n]",fileName,&seconds,timeValue) == 3)
{
count++;
if(count == linha)
{
fprintf(tempFile,"%s;%d;%srn",orderNameFile,orderSecondsFile,orderTimeFile);
}
else
{
fprintf(tempFile,"%s;%d;%srn",fileName,seconds,timeValue);
}
}
fclose(tempFile);
fclose(orderFile);
remove("order.txt");
rename("temp.txt","order.txt");
我还包含了stdio.h lib
#include <stdio.h>
然而,当我运行此代码时,它会在 remove 函数上给出一个错误,说:
错误:被调用的对象"Remove"不是函数或函数指针
我尝试创建一个字符名称[] = "order.txt"; 并在 remove() 中使用它; 相反,但效果不佳,也已经创建了一个像 int x 这样的 int 变量; x=remove("order.txt"); 它没有工作。
有什么想法吗?
代码中的某处有一个名为remove
的变量,请重命名它。