ofstream 解决中文路径问题

std::locale loc = std::locale::global(std::locale(""));

	ofstream testOFstream("C:\\测试.txt");

	if (testOFstream.is_open())

	{

		testOFstream<<"this is a test\n";

		testOFstream<<"this is another test";

		testOFstream.close();

	}

std::locale::global(std::locale(loc ));

你可能感兴趣的:(Stream)