How can I delete a folder using C++?
If no cross-platform way exists, then how to do it for the most-popular OSes - Windows, Linux, Mac, iOS, Android? Would a POSIX
This works for deleting all the directories and files within a directory.
#include
#include
#include
using namespace std;
int main()
{
cout << "Enter the DirectoryName to Delete : ";
string directoryName;
cin >> directoryName;
string a = "rmdir /s /q " + directoryName;
system(a.c_str());
return 0;
}