【发布时间】:2016-05-17 10:16:02
【问题描述】:
使用 wfstream 我正在尝试编写一些已处理的内容,从文件中删除旧内容。
wfstream cSrcFileOutput(m_cstrFile);
wfstream cSrcFileInput(m_cstrFile);
std::wstring cstrSrcFileContent;
....
cstrSrcFileContent 有我的内容
我写如下:
cSrcFileOutput.write(cstrSrcFileContent.c_str(), cstrSrcFileContent.size()*sizeof(wchar_t));
问题是它没有清除以前的数据。而是在文件中的某处插入处理过的内容。
我想用新处理的内容替换旧内容。
请提出建议。
【问题讨论】: