函數原型int unlink(const char *fname)
函數用途:删除一个指定文件
輸入參數:fname 要删除的文件名称
返回值:0-操作成功,-1 操作失败
實例:
#include <stdio.h>
#include <io.h>
int main(void)
{
FILE *fp = fopen("junk.jnk","w");
int status;
fprintf(fp,"junk");
status = access("junk.jnk",0);
if (status == 0)
printf("File exists
");
else
printf("File doesn't exist
");
fclose(fp);
unlink("junk.jnk");
status = access("junk.jnk",0);
if (status == 0)
printf("File exists
");
else
printf("File doesn't exist
");
return 0;
}
------------------------
建議去下載置顶贴中的TC-2.0函數查詢軟件。