fstream如何打开中文路径 - [C/C++]

摘要: 版权声明:转载时请以超链接形式标明文章原始出处和作者信息及本声明http://yzyanchao.blogbus.com/logs/35621328.html VS2005开始(似乎),用ofstream打开中文路径名会出现乱码问题,解决方法为:std::locale loc = std::locale::global(std::locale(""));std::ofstream fout(FilePath);//do some work herefout.close();std::locale::global( loc );不加最后一句,cout回无法输出中文字符。 阅读全文
posted @ 2011-05-19 14:15 几百人有爱 阅读(497) 评论(0) 推荐(0)