Working directory

1.4k views Asked by At

How do I make the working directory the "debug directory" but not through the properties, but through the code?

2

There are 2 answers

1
Dave On BEST ANSWER
chdir ("Debug");

That's what I use for Windows apps.

Obviously, the directory "Debug" would be inside the current working directory. To go up a level:

chdir("..");

Or to make a directory:

mkdir("Debug");

Incidentally, if you need to know where your working directory currently is, use something like:

char workingDir [_MAX_PATH];
_getcwd( workingDir, _MAX_PATH );
0
MSalters On

In your own code, there's no such thing as a "debug directory". That's a property of your debugger or IDE.