wstring の場合
[cpp]
#include <iostream>
#include <fstream>
int main()
{
std::wstring text(L"hello, world");
std::basic_ofstream<wchar_t> ofs("C:\\hoge1.txt", std::ios::binary);
ofs.write(text.data(), text.size());
}
[/cpp]
kaizawa
闘う兼業主夫プログラマー。外資系IT企業所属。C++、Java、Solaris、Oracle、セキュリティ、DLP(Data Loss Prevention)、D&D、空手二段(極真会館)、柔道初段、柔術白帯ストライプ3(トライフォース)。English/中文