CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Apr 2001
    Posts
    27

    Getting the current working directory

    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?

  2. #2
    Join Date
    Mar 2002
    Location
    California
    Posts
    1,582
    There are two methods available, getcwd() and the windows SDK method GetCurrentDirectory(). You should be able to find documentation on their use.

    Jeff

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured