How to save the created txt file to a specified path? For example to C:\ Drive. When the code creates a file it saves to the workspace folder of the project. Do I have to set the directory to C:\? I tried using SetCurrentDirectoryA
function but does not change to the specified directory.
This is one of the ways I tried:
void createFile(){
ofstream file("C:\\sample.txt");
file.close();
}