Since you added the visual-c++ tag I’m going to suggest the standard windows function to do it. GetCurrentDirectory
Usage:
TCHAR pwd[MAX_PATH];
GetCurrentDirectory(MAX_PATH,pwd);
MessageBox(NULL,pwd,pwd,0);
More Related Contents:
- Why the values {1, 1, 0, -1, -1, -1, 0, 1} and {0, 1, 1, 1, 0, -1, -1, -1} were chosen for dx[dir] and dy[dir]? [closed]
- How can this code be reversed? (recursion)
- Hi, Just Want to Know What This Error Means
- How to determine if a string is a number with C++?
- How to call C++ function from C?
- Macro for dllexport/dllimport switch
- What is “Expression SFINAE”?
- C++ Static member method call on class instance
- Automatically stop Visual C++ 2008 build at first compile error?
- Difference in performance between MSVC and GCC for highly optimized matrix multplication code
- C++ Compiler Error C2280 “attempting to reference a deleted function” in Visual Studio 2013 and 2015
- StdAfx + Header file – Order of inclusion in MFC application
- Why floating point value such as 3.14 are considered as double by default in MSVC?
- How to play or open *.mp3 or *.wav sound file in c++ program? [closed]
- Difference between ‘strcpy’ and ‘strcpy_s’?
- How to get a color palette from an image using OpenCV [closed]
- Value initialization and Non POD types
- Errors when linking to protobuf 3 on MS Visual C
- Why do I get _CrtIsValidHeapPointer(block) and/or is_block_type_valid(header->_block_use) assertions?
- How to use libraries compiled with MingW in MSVC?
- Strange ambiguous call to overloaded function error
- How to find out cl.exe’s built-in macros
- Problems with running EXE file built with Visual Studio on another computer
- Visual c++ “for each” portability
- OpenCV SURF function is not implemented
- How do I iterate over a Constant Vector?
- How do I temporarily disable a macro expansion in C/C++?
- Expand macro inside string literal
- Measuring exception handling overhead in C++
- How to create a process in C++ on Windows?