As of today, C++17's <filesystem>
is the proper solution.
#include <filesystem>int main(){ std::filesystem::copy("C:/Users/", "E:/Backup/");}
The slashes (/
) are interpreted as directory separators, this is easier to read than a double back-slash (\\
).