#include <filesystem> std::filesystem::remove("myEmptyDirectoryOrFile"); // Deletes empty directories or single files. std::filesystem::remove_all("myDirectory"); // Deletes one or more files recursively.