#include <stdio.h>
string path = "D:\\text.txt";
remove(path.c_str());
或者 remove("D:\\text.txt");
使用时需要保证文件没有被占用或读取。
参考链接:
https://blog.youkuaiyun.com/lucyjiayou/article/details/6059107
https://bbs.youkuaiyun.com/topics/360140579
博客给出了在C语言中使用remove函数删除文件的示例,代码展示了两种调用方式,一是通过变量指定文件路径,二是直接指定路径。同时提醒使用时要保证文件未被占用或读取,还提供了相关参考链接。
#include <stdio.h>
string path = "D:\\text.txt";
remove(path.c_str());
或者 remove("D:\\text.txt");
使用时需要保证文件没有被占用或读取。
参考链接:
https://blog.youkuaiyun.com/lucyjiayou/article/details/6059107
https://bbs.youkuaiyun.com/topics/360140579
您可能感兴趣的与本文相关的镜像
Stable-Diffusion-3.5
Stable Diffusion 3.5 (SD 3.5) 是由 Stability AI 推出的新一代文本到图像生成模型,相比 3.0 版本,它提升了图像质量、运行速度和硬件效率

被折叠的 条评论
为什么被折叠?
