Visual Studio设置工作目录

代码中获取该目录:

#include <Windows.h>
int main()
{
	WCHAR utf16Path[1024] = { 0 };
	GetCurrentDirectoryW(sizeof(utf16Path) - 1, utf16Path);

	char utf8Path[2048] = { 0 };
	int nNum = WideCharToMultiByte(CP_UTF8, 0, utf16Path, -1, utf8Path, sizeof(utf8Path), NULL, NULL);
	getchar();
	return 0;
}

猜你喜欢

转载自blog.csdn.net/auccy/article/details/118301967
今日推荐