Click to See Complete Forum and Search --> : Getting the current working directory


partyman66
June 25th, 2002, 02:18 PM
Does anyone know how to get the current working directory in C++? The only way i can think of is an inefficient way..and that would be to do a

system("pwd > file.txt");

and read it from that file.

There must be a more efficient way.

Any ideas?

jfaust
June 25th, 2002, 02:45 PM
There are two methods available, getcwd() and the windows SDK method GetCurrentDirectory(). You should be able to find documentation on their use.

Jeff