You can use the <direct.h> subsystem ( <direct.h> ) and access the functions
_getcwd()/_wgetcwd() Gets the current working directory
_chdir()/_wchdir() Sets the current working directory
If you need your cross-platform code, you can do the following:
#ifdef _WIN32 # include <direct.h> # define getcwd _getcwd # define chdir _chrdir #else # include <unistd.h> #endif
and use getcwd and chdir (without the main underscore).
Kitsuneymg
source share