c++删除文件操作remove

来源:互联网 发布:门禁卡破解软件 编辑:程序博客网 时间:2024/04/26 05:00

用remove函数功 能: 删除一个文件

用 法: int remove( const char *filename);
头文件:在Visual C++ 6.0中可以用stdio.h
返回值:如果删除成功,remove返回0,否则返回EOF(-1)。
例:#include <stdio.h>
int main()
{ 
if(remove("1.txt")) 
printf("Could not delete the file &s /n","1.txt"); 
else printf("OK /n");
return 0;
}

原创粉丝点击