文件输出 wstring string

#include <fstream>
#include <string>
#include <iostream>

int main()
{
    std::string input;
    std::cin >> input;
    std::ofstream out("output1.txt", std::ios::app);
    out << input;
    out.close();

    std::locale::global(std::locale(""));
    std::wofstream fout("output2.txt", std::ios::app);
    fout << L"嘿嘿嘿嘿嘿" << std::endl;
    fout.close();
    return 0;
}

 

 
std::ios::app 追加
 
 
posted @ 2021-07-07 09:23  冰糖葫芦很乖  阅读(127)  评论(0编辑  收藏  举报