如何用C语言删除一个文件?想用remove函数。从键盘上输入要删除的文件名。可不知如何编写,大师可否写个例子啊。
#include<stdio.h>
int main(){
char filename[80];
printf("The file to delete:");
gets(filename);
if( remove(filename) == 0 )
printf("Removed %s.", filename);
else
perror("remove");
}