#how do i get the current directory the exe is inside, to save a file called auth.gk, must be GNU

12 messages · Page 1 of 1 (latest)

young cairn
#

ofstream myfile;
myfile.open("auth.gk", std::fstream::in | std::fstream::out | std::fstream::app);
myfile << ChOK4;
myfile.close();

worn wadiBOT
#

When your question is answered use !solved to mark the question as resolved.

Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question use !howto ask.

round jay
#

First argument in argv is usually the path of the executable

icy depot
#

if you run the exe from the cwd, they'll always be the same wesmart

#

right, I forgot about that

magic palm
#

cant you just start the path with a dot and then just use relative paths

#

isnt that how that works

icy depot
#

. is relative to the CWD

magic palm
#

ohh yea

young cairn
#

!solved