What is the simplest way to get the directory that a file is in? I\'m using this to find the working directory.
string filename = \"C:\\MyDirectory\\MyFile.b
C++17 provides std::filesystem::path. It may be available in C++11 in ; link with -lstdc++fs. Note the function does not validate the path exists; use std::filesystem::status to determine type of file (which may be filetype::notfound)