I was thinking to have my program print its directory to a file and then
system("cd") >> "ok.txt";
read from "ok.txt" to retrieve the current working directory, but it is a bit complicated.
Any other idea to save my current working directory to a variable?