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?