文件输出 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; }