Cross-platform way to change working program directory...
I have the following code which changes the working directory of the program to where the program is located. I do this so that my application can correctly find all necessary resources needed to run.
My question is, what is the cross-platform way to do this in Qt?
Thank you for your time.
This is in the int main() function:
Change current directory of program to where executable is. */ std::string ProgramPath(argv); std::string WorkingDirectory; size_t found; found = ProgramPath.find_last_of("/\\"); WorkingDirectory = ProgramPath.substr(0, found);
/* End change of working directory. */
This works! Thank you for your time.