#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
#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