wstring写文件

来源:互联网 发布:java 工作流引擎有哪些 编辑:程序博客网 时间:2024/06/04 00:21
原创出处:http://bbs.csdn.net/topics/350181188

#include <string>
#include <fstream>
using namespace std;
 
int _tmain(int argc, TCHAR* argv[], TCHAR* envp[])
{
    wstring result = L"Hell,World!";
    wofstream f;
    f.open(L"F:\\11.txt",wios::app);
    f <<result.c_str()<<endl;
    f.close();
    return 0;
}