获取C++项目运行绝对路径:
// filePath 就是项目所在绝对路径
char* projectPath = nullptr;
projectPath = _getcwd(nullptr, 1);
string filePath(projectPath);
...
// 用完删除
delete projectPath;
projectPath = nullptr;
获取C++项目运行绝对路径:
// filePath 就是项目所在绝对路径
char* projectPath = nullptr;
projectPath = _getcwd(nullptr, 1);
string filePath(projectPath);
...
// 用完删除
delete projectPath;
projectPath = nullptr;