文件系统“ remove_all”漏洞不是定义的错误
您好,我启动了C ++和IM使用Visual Studio 2017,我希望DELETIN在文件夹中的所有文件/文件夹中,我尝试了此代码:
#include <iostream>
#include <filesystem>
using namespace std;
int main()
{
remove_all("C:\myfolder");
printf("All items deleted!");
return 0;
}
remove();
对我有用,但是 remove_all();
甚至不起作用,即使我使用 #include&lt; filesystem&gt;
这是我使用 remove> remove_all();
::
严重性代码描述项目文件行隐藏状态错误(活动) e0020“ remove_all”漏洞未定义。
可以修复吗?还是还有另一种方法可以删除文件夹中的所有文件?
不是:我的VisualStudio太懒惰了,有时它会显示出错误,即使我修复了错误。谢谢
我的C ++版本:
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我修改了摘要:添加
filesystem ::
和\\
并在Project属性中使用C ++ 17。(右键单击该项目,您将看到
属性< /代码>在最后一行的页面)
I modified the snippet: added
filesystem::
and\\
And use the C++ 17 in Project's properties.(Right click the project and you will see the

properties
page on the last line )