In the code on moodle to see where the execution (cwd) paths is use:
int main(int argc, char** argv) { // This should show the CWD / execution path of the code std::cout << argv[0] << std::endl; //........ }
The text was updated successfully, but these errors were encountered:
Updated the code on Moodle to include this and the new C++17 filesystem library:
#include <filesystem> using namespace std; int main(int argc, char* argv[]) { cout << "being exectued from:" << endl; cout << argv[0] << endl; std::filesystem::path cwd = std::filesystem::current_path() / "filename.txt"; // C++17 cout << "but the input.txt and output.txt files should be be in the following directory:" << endl; cout << cwd.string() << endl << endl; // etc...
Will add source code and perhaps slides to a new CU GitHub repo at a later date.
Sorry, something went wrong.
No branches or pull requests
pateln50 commentedOct 11, 2019
•
edited
In the code on moodle to see where the execution (cwd) paths is use:
The text was updated successfully, but these errors were encountered: