阅读量:125
在C++中,可以使用std::filesystem::current_path()函数来获取当前路径。需要包含头文件。
以下是一个示例代码:
#include
#include
int main() {
std::filesystem::path currentPath = std::filesystem::current_path();
std::cout << "Current Path: " << currentPath class="hljs-keyword">return 0;
}
此代码将输出当前路径。