C++获取项目当前路径

可以通过_getcwd()获取项目当前路径,代码如下

#include <iostream> 
#include <iomanip>
#include <direct.h>

int main()
{
	//C++查看系统当前目录
	char buffer[_MAX_PATH];
	_getcwd(buffer, _MAX_PATH);
	std::cout << buffer << std::endl;
	system("Pause");
	return -1;
}

猜你喜欢

转载自blog.csdn.net/ye_wolf/article/details/79621269