How would I prompt a user to enter a directory and then write to it? I've used ofstream to open a disk file and wrote it that way, but that doesn't let me specify WHERE i want to put it, it just defaults to the current directory (right?).
So, what if I wanted to ask the user where to put the file? How would I accomplish telling my program to write the file to the desired location?
std::ofstream file1("/unix/absolute/path/to/file"); //Also valid on Windows, but / is the root of the
//volume the working directory is in.
std::ofstream file2("c:\\windows\\absolute\\path\\to\\file"); //Forward slashes also work.
std::ofstream file3("relative/path/to/file");